-
Notifications
You must be signed in to change notification settings - Fork 4
Containerise dependencies required to run tasks in dev workflow #53
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
…/platform-examples into em/dockerize-wg-easy-dependencies
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started to call out everywhere that there is 'docker' and then realized you've labeled that as 'to follow' so I stopped since that's still wip.
applications/wg-easy/Taskfile.yaml
Outdated
# GCP default configuration | ||
GCP_PROJECT: '{{.GCP_PROJECT | default "replicated-qa"}}' | ||
GCP_ZONE: '{{.GCP_ZONE | default "us-central1-a"}}' | ||
VM_NAME: '{{.VM_NAME | default (printf "%s-dev" (or (env "GUSER") "user"))}}' | ||
|
||
# Docker workflow configuration | ||
IMAGE_NAME: ttl.sh/wg-easy-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really shouldn't be using ttl.sh here, it's fine for development but it needs to be available somewhere else for the actual workflow. Is this currently just for you to test and you intend to move it later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently for test until we decide on
- if we need to host this image. We need to weigh the need to host the image vs users needing to build the image which take a minute.
- what OCI registry - docker hub? replicated? all of the above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we build the image and have it pushed to ghcr.io right here on this repo?
I'm fine with starting with a local build and following up with the auto-build on ghcr or if it's easy enough just build it anytime the Containerfile changes on merge to main.
I added a podman based image build/push on troubleshoot-mcp-server which might be very close to what you would need. https://github.com/chris-sanders/troubleshoot-mcp-server/blob/main/.github/workflows/publish-container.yaml
sudo \ | ||
|
||
# Install Helm | ||
&& curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this all one big RUN line?
Doesn't this mean that you're forcing the cache to be invalidated if any of these things change rather than only updating the one change? Is there a benefit to it b/c I only see a downside of breaking normal caching behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not specifying any tool versions, would any of these tools change, leading to the layer being recreated? To update the tool versions, wouldn't it require docker build --no-cache
anyway?
One, though negligible difference is the overall image size. Its smaller when using one layer. 1.23GB
vs 1.18GB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image size I believe is driven exclusively off the fact that you include && rm -rf /var/lib/apt/lists/*
in the same RUN command as the apt install
and that I'm aware of and fine with.
What I don't think you need to be doing is mixing apt and curl installs. Using all of the apt installs in a single RUN and ending it with the cleanup is good practice. Grouping independent curl
commands inside of an apt RUN command is what I would break up here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've split the RUN directives to separate debian package installs and downloading tools
Signed-off-by: Scott Rigby <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments / questions / changes
start: | ||
desc: Start development container in background | ||
silent: true | ||
cmds: | ||
- task: start-implementation | ||
|
||
# Start development container in background. | ||
# It's internal because it's used by shell and start tasks. | ||
start-implementation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following why can't this all just be in the "start" task? Task can call and require each other what does having an internal task buy you here if the real start task is just calling the internal one anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've DRY'd this bit some more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few more suggestions
Co-authored-by: Scott Rigby <[email protected]>
Co-authored-by: Scott Rigby <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
41ab16e
to
3c23789
Compare
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
Signed-off-by: Evans Mungai <[email protected]>
ghcr.io/replicatedhq/platform-examples/wg-easy-tools:latest
image. The image is also tagged withsha-<commit>
.