Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
5201cb40
Commit
5201cb40
authored
Nov 13, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `install-foundry` script to reduce `ci-builder` build time
parent
b2bf141a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
16 deletions
+41
-16
.foundryrc
.foundryrc
+1
-1
Dockerfile
ops/docker/ci-builder/Dockerfile
+6
-14
Dockerfile.dockerignore
ops/docker/ci-builder/Dockerfile.dockerignore
+1
-0
install-foundry.sh
ops/scripts/install-foundry.sh
+32
-0
package.json
package.json
+1
-1
No files found.
.foundryrc
View file @
5201cb40
d85718785859dc0b5a095d2302d1a20ec06ab77a
529559c01fabad0e6316d605fd2c4326b8ad6567
ops/docker/ci-builder/Dockerfile
View file @
5201cb40
...
@@ -2,8 +2,6 @@ FROM --platform=linux/amd64 debian:bullseye-slim as rust-build
...
@@ -2,8 +2,6 @@ FROM --platform=linux/amd64 debian:bullseye-slim as rust-build
SHELL
["/bin/bash", "-c"]
SHELL
["/bin/bash", "-c"]
WORKDIR
/opt
ENV
DEBIAN_FRONTEND=noninteractive
ENV
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
\
RUN
apt-get update
&&
\
apt-get
install
-y
curl build-essential git clang lld curl
apt-get
install
-y
curl build-essential git clang lld curl
...
@@ -21,16 +19,10 @@ RUN source $HOME/.profile && cargo install svm-rs
...
@@ -21,16 +19,10 @@ RUN source $HOME/.profile && cargo install svm-rs
# Only diff from upstream docker image is this clone instead
# Only diff from upstream docker image is this clone instead
# of COPY. We select a specific commit to use.
# of COPY. We select a specific commit to use.
COPY
./.foundryrc ./.foundryrc
COPY
./.foundryrc ./.foundryrc
RUN
git clone https://github.com/foundry-rs/foundry.git ./foundry
\
COPY
./ops/scripts/install-foundry.sh ./install-foundry.sh
&&
cd
foundry
&&
git checkout
$(
cat
../.foundryrc
)
WORKDIR
/opt/foundry
RUN
source
$HOME
/.profile
&&
\
RUN
curl
-L
https://foundry.paradigm.xyz | bash
cargo build
--release
&&
\
RUN
source
$HOME
/.profile
&&
./install-foundry.sh
strip /opt/foundry/target/release/forge
&&
\
strip /opt/foundry/target/release/cast
&&
\
strip /opt/foundry/target/release/anvil
FROM
--platform=linux/amd64 ghcr.io/crytic/echidna/echidna:v2.0.4 as echidna-test
FROM
--platform=linux/amd64 ghcr.io/crytic/echidna/echidna:v2.0.4 as echidna-test
...
@@ -81,9 +73,9 @@ COPY --from=go-build /go/bin/geth /usr/local/bin/geth
...
@@ -81,9 +73,9 @@ COPY --from=go-build /go/bin/geth /usr/local/bin/geth
COPY
--from=rust-build /root/.cargo/bin /root/.cargo/bin
COPY
--from=rust-build /root/.cargo/bin /root/.cargo/bin
COPY
--from=rust-build /root/.rustup /root/.rustup
COPY
--from=rust-build /root/.rustup /root/.rustup
# copy tools
# copy tools
COPY
--from=rust-build /
opt/foundry/target/release
/forge /usr/local/bin/forge
COPY
--from=rust-build /
root/.foundry/bin
/forge /usr/local/bin/forge
COPY
--from=rust-build /
opt/foundry/target/release
/cast /usr/local/bin/cast
COPY
--from=rust-build /
root/.foundry/bin
/cast /usr/local/bin/cast
COPY
--from=rust-build /
opt/foundry/target/release
/anvil /usr/local/bin/anvil
COPY
--from=rust-build /
root/.foundry/bin
/anvil /usr/local/bin/anvil
COPY
--from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test
COPY
--from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test
...
...
ops/docker/ci-builder/Dockerfile.dockerignore
View file @
5201cb40
...
@@ -3,3 +3,4 @@
...
@@ -3,3 +3,4 @@
!/.abigenrc
!/.abigenrc
!/.gethrc
!/.gethrc
!/.nvmrc
!/.nvmrc
!/ops/scripts/install-foundry.sh
ops/scripts/install-foundry.sh
0 → 100755
View file @
5201cb40
#!/bin/bash
set
-e
# Grab the `.foundryrc` commit hash.
SHA
=
$(
cat
./.foundryrc
)
# Check if there is a nightly tag corresponding to the `.foundryrc` commit hash
TAG
=
"nightly-
$SHA
"
# Create a temporary directory
TMP_DIR
=
$(
mktemp
-d
)
echo
"Created tempdir @
$TMP_DIR
"
# Clone the foundry repo temporarily. We do this to avoid the need for a personal access
# token to interact with the GitHub REST API, and clean it up after we're done.
git clone https://github.com/foundry-rs/foundry.git
$TMP_DIR
&&
cd
$TMP_DIR
# If the nightly tag exists, we can download the pre-built binaries rather than building
# from source. Otherwise, clone the repository, check out the commit SHA, and build `forge`,
# `cast`, `anvil`, and `chisel` from source.
if
git rev-parse
"
$TAG
"
>
/dev/null 2>&1
;
then
echo
"Nightly tag exists! Downloading prebuilt binaries..."
foundryup
-v
$TAG
else
echo
"Nightly tag doesn't exist! Building from source..."
foundryup
-C
$SHA
fi
# Remove the temporary foundry repo; Used just for checking the nightly tag's existence.
rm
-rf
$TMP_DIR
echo
"Removed tempdir @
$TMP_DIR
"
package.json
View file @
5201cb40
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
"release:publish"
:
"pnpm install --frozen-lockfile && npx nx run-many --target=build && pnpm build && changeset publish"
,
"release:publish"
:
"pnpm install --frozen-lockfile && npx nx run-many --target=build && pnpm build && changeset publish"
,
"release:version"
:
"changeset version && pnpm install --lockfile-only"
,
"release:version"
:
"changeset version && pnpm install --lockfile-only"
,
"install:foundry"
:
"curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry"
,
"install:foundry"
:
"curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry"
,
"update:foundry"
:
"
foundryup -C $(cat .foundryrc)
"
,
"update:foundry"
:
"
bash ./ops/scripts/install-foundry.sh
"
,
"install:abigen"
:
"go install github.com/ethereum/go-ethereum/cmd/abigen@$(cat .abigenrc)"
,
"install:abigen"
:
"go install github.com/ethereum/go-ethereum/cmd/abigen@$(cat .abigenrc)"
,
"print:abigen"
:
"abigen --version | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' -e 's/ /./g' -e 's/^/v/'"
,
"print:abigen"
:
"abigen --version | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' -e 's/ /./g' -e 's/^/v/'"
,
"check:abigen"
:
"[[ $(abigen --version | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' -e 's/ /./g' -e 's/^/v/') = $(cat .abigenrc) ]] && echo '✓ abigen versions match' || (echo '✗ abigen version mismatch. Run `pnpm upgrade:abigen` to upgrade.' && exit 1)"
,
"check:abigen"
:
"[[ $(abigen --version | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' -e 's/ /./g' -e 's/^/v/') = $(cat .abigenrc) ]] && echo '✓ abigen versions match' || (echo '✗ abigen version mismatch. Run `pnpm upgrade:abigen` to upgrade.' && exit 1)"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment