-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add docker build CICD #5
Conversation
.github/workflows/build.yaml
Outdated
on: | ||
push: | ||
branches: | ||
- '*' |
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.
Should be set to main before we merge it.
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.
Thanks @mrchtr,
I think there's a few things in the script we need / might want to change for a script in the example repositories, see my comments. Maybe we should leverage fondant build
instead?
.github/workflows/build.yaml
Outdated
- name: Install docker pushrm | ||
run: | | ||
sudo wget https://github.com/christian-korneck/docker-pushrm/releases/download/v1.9.0/docker-pushrm_linux_amd64 -O /usr/libexec/docker/cli-plugins/docker-pushrm | ||
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-pushrm | ||
docker pushrm --help |
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.
Does this work with github container registry?
I would be fine with leaving this out for the example images.
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.
Seems like it's not used in the script.
scripts/build_components.sh
Outdated
echo "Freezing Fondant dependency version to ${tags[0]}" | ||
|
||
docker build --push "${args[@]}" \ | ||
--build-arg="FONDANT_VERSION=${tags[0]}" \ |
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.
Custom docker files don't contain the FONDANT_VERSION
build argument.
scripts/build_components.sh
Outdated
# Add cache arguments if caching is enabled | ||
if [ "$caching" = true ] ; then | ||
|
||
cache_name=ghcr.io/${namespace}/${BASENAME}:build-cache | ||
echo "Caching from/to ${cache_name}" | ||
args+=(--cache-to "type=registry,ref=${cache_name}") | ||
args+=(--cache-from "type=registry,ref=${cache_name}") | ||
fi |
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 would leave out caching for custom images. It adds a lot of complexity while it's mostly useful when you have a lot of images.
scripts/build_components.sh
Outdated
echo "Updating the image version in the fondant_component.yaml with:" | ||
echo "${full_image_names[0]}" | ||
sed -i -e "s|^image: .*|image: ${full_image_names[0]}|" fondant_component.yaml |
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 not needed for CI/CD, and for other usage, their's now the fondant build
command.
scripts/build_components.sh
Outdated
full_image_names=() | ||
echo "Tagging image with following tags:" | ||
for tag in "${tags[@]}"; do | ||
full_image_name=ghcr.io/${namespace}/${BASENAME}:${tag} |
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 might want to keep the registry parametrized so users can easily switch to a different registry.
scripts/build_components.sh
Outdated
echo " -r, --registry <value> The docker registry prefix to use (default: null for DockerHub)" | ||
echo " -n, --namespace <value> The DockerHub namespace for the built images (default: fndnt)" |
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.
Some outdated documentation 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.
Thanks @mrchtr!
Seems to be working 👍
Can you update the branch name in the workflow before merging?
Add script to build and push the custom component to
ghcr.io
Set the label to
org.opencontainers.image.source=https://github.com/ml6team/fondant-usecase-RAG