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

Lightnode docker #726

Merged
merged 23 commits into from
Sep 11, 2024
Merged

Conversation

cody-littley
Copy link
Contributor

@cody-littley cody-littley commented Aug 27, 2024

Why are these changes needed?

Create a docker image suitable for running the light node on a raspberry pi.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • hand tests
    • Unit tests
    • Integration tests
    • This PR is not tested :(

Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley self-assigned this Aug 27, 2024
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
export GIT_URL=https://github.com/Layr-Labs/eigenda.git

# The name of the branch or the commit sha to clone.
export BRANCH_OR_COMMIT=master
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to use the commit that is currently checked out? Curious about the thought process here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to that idea, but we should weigh pros and cons.

This build process clones the repo into the docker image, as opposed to using the copy on the host file system. This adds extra overhead. The reason I took this step was that I wanted to avoid uncommitted local changes accidentally making their way into the resulting docker file, as well as requiring an explicit choice when it comes to choosing which version to build. But there is certainly additional friction to the developer in doing it this way. Let's discuss.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per our discussion, I've changed this so that it instead builds against the code that is checked out locally (as opposed to cloning the code inside the docker file).

Signed-off-by: Cody Littley <[email protected]>
@anupsv
Copy link
Contributor

anupsv commented Sep 5, 2024

In general, are we going to publish these docker builds as part of releases? If so, we should consider signing the containers and GHCR does enable this.

@cody-littley
Copy link
Contributor Author

@anupsv

In general, are we going to publish these docker builds as part of releases? If so, we should consider signing the containers and GHCR does enable this.

I'm guessing the answer is "yes", although I haven't spent much time yet thinking about releases. Would it be ok with you if we addressed this as a stand alone task? This docker image will be useful during testing as we do development work.

@anupsv
Copy link
Contributor

anupsv commented Sep 7, 2024

@anupsv

In general, are we going to publish these docker builds as part of releases? If so, we should consider signing the containers and GHCR does enable this.

I'm guessing the answer is "yes", although I haven't spent much time yet thinking about releases. Would it be ok with you if we addressed this as a stand alone task? This docker image will be useful during testing as we do development work.

Yep thats fine.


# Download all go dependencies and build the binary.
WORKDIR /home/lnode/eigenda/lightnode
RUN go mod download
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think a worthwhile optimization would be the following sequence:

  1. copy go.mod
  2. Run go mod download
  3. Copy the remainder of source
  4. Run build

This would prevent having to redownload the go modules every time the source changes (as long as modules don't change)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good suggestion. Change made.

Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley merged commit 6a831eb into Layr-Labs:master Sep 11, 2024
6 checks passed
@cody-littley cody-littley deleted the lightnode-docker branch September 11, 2024 13:02
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.

4 participants