Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build and push - part 1 #56

Merged
merged 160 commits into from
Dec 19, 2024
Merged

Docker build and push - part 1 #56

merged 160 commits into from
Dec 19, 2024

Conversation

magick93
Copy link

@magick93 magick93 commented Nov 27, 2024

Issue Addressed

  • Docker build and push only runs if tests and code quality passes
  • Removed step to create multi-arch docker manifest.
  • Added labels to the docker image, including git.revision - for provenance.

Which issue # does this PR address? See #28

NB: this is using the Hashicorp Vault Action to retrieve the docker username and key.

I'll followup in a less public forum regarding these details.

Follow-up tasks

  • Correctly configure HSC with correct details

hardcode docker repo, set dockerfile location
use Cargo.toml as source of truth
fix path for toml_reader.sh
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This looks great.

Left a few comments about some code changes.

The extra script files about getting the rust version (and splitting up the extract-version workflow) was this to avoid putting the architecture into the name? Or to handle the case that we don't yet have a tag or release? Just curious as to why we shifted from the original version we use in Lighthouse.

Everything else looks good to me :)


- name: Dockerhub login
run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these have changed. They are now DH_ORG and DH_KEY I think

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these workflows we are not trusting github to responsibility protect the dockerhub token in perpetuity. Instead we give it on demand, and approval, via vault.
While it does use DOCKER_USERNAME and DOCKER_PASSWORD vars internally, the only variable that needs to be set in Github is to add your org token. See https://www.notion.so/sigp/HashiCorp-Vault-12a56eefb55e8023bb58de9d57cfe2b8


env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also

if: startsWith(matrix.arch, 'x86_64-windows') != true
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i have to add these, or find someone who has them to add

# The formatting here is borrowed from OpenEthereum: https://github.com/openethereum/openethereum/blob/main/.github/workflows/build.yml
run: |
body=$(cat <<- "ENDBODY"
<Rick and Morty character>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jking-aus - and others. We probably need to come up with a release naming scheme.

- [ ] Run on synced Holesky Sigma Prime nodes.
- [ ] Run on synced Canary (mainnet) Sigma Prime nodes.
- [ ] Resync a Holesky node.
- [ ] Resync a mainnet node.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a draft release checklist. These will likely need to be modified at some point for anchor specifically. Things we want to check before a release. @jking-aus


## Binaries

[See pre-built binaries documentation.](https://anchor-book.sigmaprime.io/installation-binaries.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to make sure this URL exists, i.e add it to the md-book. @jking-aus

Cargo.lock Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
anchor/src/environment.rs Outdated Show resolved Hide resolved
@magick93
Copy link
Author

magick93 commented Dec 11, 2024

This extract-workflow is to reduce duplication. We need to get the version for both binary and docker releases.
The arch is still in the name - see https://hub.docker.com/r/magick93/anchor/tags and https://github.com/magick93/anchor/releases.

The use of .github/scripts/toml_reader.sh was to simplify and for reuse. Also, I was thinking of using the rust version from the Cargo.toml as a value in the docker rust builder image. I'm currently not sure if this is needed - maybe cross takes care of this. I need to investigate further.

@jking-aus
Copy link
Contributor

hey anton can you just resolve the minor conflict so I can squash and merge? If I do it my review wont approve the pr

@magick93
Copy link
Author

hey anton can you just resolve the minor conflict...

@jking-aus - done

Copy link
Contributor

@jking-aus jking-aus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jking-aus jking-aus merged commit 99a5004 into sigp:unstable Dec 19, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants