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

Create separate docker image for stacks-signer #4683

Open
wileyj opened this issue Apr 13, 2024 · 5 comments
Open

Create separate docker image for stacks-signer #4683

wileyj opened this issue Apr 13, 2024 · 5 comments
Assignees

Comments

@wileyj
Copy link
Contributor

wileyj commented Apr 13, 2024

          Looks good.

Alternatively, a different image would need to be published for the signer.

Originally posted by @friedger in #4682 (review)

@wileyj wileyj self-assigned this Apr 13, 2024
@ldiego08
Copy link

@wileyj I'd like to assist with this issue. Based on this Dockerfile, would it be just adding the stacks-signer output? If so, what the CMD would be for that image (or the expected usage)?

@wileyj
Copy link
Contributor Author

wileyj commented Jun 4, 2024

@wileyj I'd like to assist with this issue. Based on this Dockerfile, would it be just adding the stacks-signer output? If so, what the CMD would be for that image (or the expected usage)?

thanks for the offer, but it's a little more complicated than that - that dockerfile already contains the signer binary, since it's pulling a pre-built binary from the release page. the method that builds those archives is here: https://github.com/stacks-network/actions/blob/main/stacks-core/create-source-binary/build-scripts
i.e. https://github.com/stacks-network/actions/blob/main/stacks-core/create-source-binary/build-scripts/Dockerfile.linux-glibc-x64#L21

here's where it gets tricky though - right now, the current method is to build all the binaries, upload that archive to the releases page. the problem is that using this method means the signer can only be released when stacks-core is released (since the binary is only built as part of the release process).

one idea we've been thinking about is having a separate release process for the signer. the CI workflows will likely need to change quite a bit, but the overall idea is to release stacks-core normally like we do now (with the signer) using the existing 5 part versioning.
then, add a new ci workflow to release only the signer, which would assume a 6 part versioning (in between stacks-core releases).

it's possible we could re-use the dockerfile you linked, maybe add an ARG or something if we're only building the signer image? the same would need to be done for the stacks-network/actions repo (some kind of flag so we build the archive of only the signer, or everything in the case of stacks-core).

@BowTiedDevOps is looking into the ci workflow changes, but if you wanted to take a shot at the dockerfile changes, happy to consider any ideas you may have there.

@ldiego08
Copy link

ldiego08 commented Jun 4, 2024

@wileyj, thanks for your reply! I'm new to the repo, but overhauling the CI workflows to accurately reflect the released artifacts sounds like a better, long-term solution. I'll look into this further and get back to you.

@wileyj
Copy link
Contributor Author

wileyj commented Jun 4, 2024

@wileyj, thanks for your reply! I'm new to the repo, but overhauling the CI workflows to accurately reflect the released artifacts sounds like a better, long-term solution. I'll look into this further and get back to you.

there's always room for help if you're inclined - i would look at the dockerfiles in the actions repo folder i linked in previous comment. i'm pretty sure we can re-use those to build release binaries for both the signer, and in the case of stacks-core - all the binaries.

offhand, i think setting some kind of build arg in the dockerfile should be enough. i.e.
https://github.com/stacks-network/actions/blob/main/stacks-core/create-source-binary/action.yml#L74

        build-args: |
          STACKS_NODE_VERSION=${{ inputs.tag || env.GITHUB_SHA_SHORT }}
          ...
          SIGNER_ONLY=true # set to true if only building the signer, blank if all binaries. this should be set as in input variable

and then in the dockefiles, i.e.

ENV SIGNER=${TARGET_CPU}
...
if [ $SIGNER ]; then
  BUILD_FLAG="--bins stacks-signer"
fi
...
&& cargo build --features monitoring_prom,slog_json --release --workspace --target ${TARGET} ${BUILD_FLAG}

total pseudo-code by the way, but that's the idea i was thinking of

@wileyj
Copy link
Contributor Author

wileyj commented Jul 17, 2024

#4968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

2 participants