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
3be573c9
Unverified
Commit
3be573c9
authored
Oct 16, 2024
by
Adrian Sutton
Committed by
GitHub
Oct 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cannon: Add a script to build multicannon with support for legacy versions. (#12455)
parent
59ba5f37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
Makefile
cannon/Makefile
+4
-0
build-legacy-cannons.sh
cannon/scripts/build-legacy-cannons.sh
+59
-0
Dockerfile
ops/docker/op-stack-go/Dockerfile
+1
-1
No files found.
cannon/Makefile
View file @
3be573c9
...
@@ -21,6 +21,10 @@ cannon32-impl:
...
@@ -21,6 +21,10 @@ cannon32-impl:
cannon64-impl
:
cannon64-impl
:
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
--tags
=
cannon64
-v
$(LDFLAGS)
-o
./bin/cannon64-impl .
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
--tags
=
cannon64
-v
$(LDFLAGS)
-o
./bin/cannon64-impl .
# Note: This target is used by ./scripts/build-legacy-cannons.sh
# It should build the individual versions of cannons and copy them into place in hte multicannon/embeds directory
# Ideally, preserve backwards compatibility with this behaviour but if it needs to change, build-legacy-cannons.sh will
# need to be updated to account for different behaviours in different versions.
cannon-embeds
:
cannon32-impl cannon64-impl
cannon-embeds
:
cannon32-impl cannon64-impl
# singlethreaded-v2
# singlethreaded-v2
@
cp
bin/cannon32-impl ./multicannon/embeds/cannon-2
@
cp
bin/cannon32-impl ./multicannon/embeds/cannon-2
...
...
cannon/scripts/build-legacy-cannons.sh
0 → 100755
View file @
3be573c9
#!/bin/bash
set
-euo
pipefail
SCRIPTS_DIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
# This script builds a version of the cannon executable that includes support for both current and legacy state versions.
# Each cannon release is built
TMP_DIR
=
$(
mktemp
-d
)
function
cleanup
()
{
rm
-rf
"
${
TMP_DIR
}
"
}
trap
cleanup EXIT
echo
"Using temp dir:
${
TMP_DIR
}
"
cd
"
${
TMP_DIR
}
"
# Need to check out a fresh copy of the monorepo so we can switch to specific tags without it also affecting the
# contents of this script (which is checked into the repo).
git clone https://github.com/ethereum-optimism/optimism
--recurse-submodules
CANNON_DIR
=
"
${
SCRIPTS_DIR
}
/../"
EMBEDS_DIR
=
"
${
CANNON_DIR
}
/multicannon/embeds"
LOGS_DIR
=
"
${
CANNON_DIR
}
/temp/logs"
REPO_DIR
=
"
${
TMP_DIR
}
/optimism"
BIN_DIR
=
"
${
REPO_DIR
}
/cannon/multicannon/embeds"
mkdir
-p
"
${
LOGS_DIR
}
"
cd
"
${
REPO_DIR
}
"
function
buildVersion
()
{
TAG
=
${
1
}
LOG_FILE
=
"
${
LOGS_DIR
}
/build-
$(
echo
"
${
TAG
}
"
|
cut
-c
8-
)
.txt"
echo
"Building Version:
${
TAG
}
Logs:
${
LOG_FILE
}
"
git checkout
"
${
TAG
}
"
>
"
${
LOG_FILE
}
"
2>&1
git submodule update
--init
--recursive
>>
"
${
LOG_FILE
}
"
2>&1
rm
-rf
"
${
BIN_DIR
}
/cannon-"
*
make
-C
"
${
REPO_DIR
}
/cannon"
cannon-embeds
>>
"
${
LOG_FILE
}
"
2>&1
cp
"
${
BIN_DIR
}
/cannon-"
*
"
${
EMBEDS_DIR
}
/"
echo
"Built
${
TAG
}
with versions:"
(
cd
"
${
BIN_DIR
}
"
&&
ls
cannon-
*
)
}
# Build each release of cannon from earliest to latest. Releases with qualifiers (e.g. `-rc`, `-alpha` etc are skipped.
# If the same state version is supported by multiple version tags built, the build from the last tag listed will be used
# The currently checked out code is built after this list to include the currently supported state versions and
# build the final cannon executable.
VERSIONS
=
$(
git tag
--list
'cannon/v*'
--sort
taggerdate |
grep
-v
--
'-'
)
for
VERSION
in
${
VERSIONS
}
do
buildVersion
"
$VERSION
"
done
cd
"
${
CANNON_DIR
}
"
LOG_FILE
=
"
${
LOGS_DIR
}
/build-current.txt"
echo
"Building current version of cannon Logs:
${
LOG_FILE
}
"
make cannon
>
"
${
LOG_FILE
}
"
2>&1
echo
"All cannon versions successfully built and available in
${
EMBEDS_DIR
}
"
"
${
CANNON_DIR
}
/bin/cannon"
list
ops/docker/op-stack-go/Dockerfile
View file @
3be573c9
...
@@ -47,7 +47,7 @@ ARG TARGETARCH
...
@@ -47,7 +47,7 @@ ARG TARGETARCH
# The "id" defaults to the value of "target", the cache will thus be reused during this build.
# The "id" defaults to the value of "target", the cache will thus be reused during this build.
# "sharing" defaults to "shared", the cache will thus be available to other concurrent docker builds.
# "sharing" defaults to "shared", the cache will thus be available to other concurrent docker builds.
FROM
--platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:v1.0.0
-alpha.3
AS cannon-builder-0
FROM
--platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:v1.0.0 AS cannon-builder-0
FROM
--platform=$BUILDPLATFORM builder AS cannon-builder
FROM
--platform=$BUILDPLATFORM builder AS cannon-builder
ARG
CANNON_VERSION=v0.0.0
ARG
CANNON_VERSION=v0.0.0
...
...
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