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

Add github action to push docker images with latest tag. #370

Merged
merged 22 commits into from
Jul 10, 2024

Conversation

revit13
Copy link
Collaborator

@revit13 revit13 commented Jul 2, 2024

Why are these changes needed?

This PR automates the process of pushing Docker images with latest tag upon each merge to the development branch. It accomplishes this by storing the images generated during the execution of the test-image target using the https://github.com/actions/upload-artifact action and subsequently downloading and pushing them to the repository following the completion of testing.
It also changes ray docker images to have a base image and thus avoids the need to call update_dockerfile.sh script to update the ray version in set-versions.

the pushed images rae:

quay.io/dataprep1/data-prep-kit/proglang_select-ray:latest
quay.io/dataprep1/data-prep-kit/proglang_select-python:latest
quay.io/dataprep1/data-prep-kit/malware-ray:latest
quay.io/dataprep1/data-prep-kit/malware-python:latest
quay.io/dataprep1/data-prep-kit/code_quality-ray:latest
quay.io/dataprep1/data-prep-kit/code_quality-python:latest
quay.io/dataprep1/data-prep-kit/code2parquet-ray:latest
quay.io/dataprep1/data-prep-kit/code2parquet-python:latest
quay.io/dataprep1/data-prep-kit/lang_id-ray::latest
quay.io/dataprep1/data-prep-kit/tokenization-ray:latest
quay.io/dataprep1/data-prep-kit/tokenization-python:latest
quay.io/dataprep1/data-prep-kit/resize-ray:latest
quay.io/dataprep1/data-prep-kit/resize-python:latest
quay.io/dataprep1/data-prep-kit/profiler-ray:latest
quay.io/dataprep1/data-prep-kit/noop-spark:latest
quay.io/dataprep1/data-prep-kit/noop-ray:latest
quay.io/dataprep1/data-prep-kit/noop-python:latest
quay.io/dataprep1/data-prep-kit/filter-spark:latest
quay.io/dataprep1/data-prep-kit/filter-ray:latest
quay.io/dataprep1/data-prep-kit/filter-python:latest
quay.io/dataprep1/data-prep-kit/fdedup-ray:latest
quay.io/dataprep1/data-prep-kit/ededup-ray:latest
quay.io/dataprep1/data-prep-kit/doc_id-spark:latest
quay.io/dataprep1/data-prep-kit/doc_id-ray:latest
quay.io/dataprep1/data-prep-kit/data-prep-kit-spark-3.5.1:latest
quay.io/dataprep1/data-prep-kit/lang_id-python:latest
quay.io/dataprep1/data-prep-kit/lang_id-ray:latest
quay.io/dataprep1/data-prep-kit/kfp-data-processing:latest

Related issue number (if any).

#176

Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@revit13 revit13 force-pushed the github13 branch 8 times, most recently from 6fa57c5 to 4a5dc5e Compare July 4, 2024 21:27
@revit13 revit13 marked this pull request as ready for review July 5, 2024 03:33
@revit13 revit13 force-pushed the github13 branch 2 times, most recently from 122a094 to 9e69e11 Compare July 6, 2024 18:54
cat << EOF
"Incorrect number of parameters provided. The required parameters are versions_file and pipeline_path.
$1 $2
Copy link
Member

Choose a reason for hiding this comment

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

should we add more explanation here? instead just $1 and $2

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks I removed the redundant printing...

FROM docker.io/rayproject/ray:2.24.0-py310
ARG BASE_IMAGE=docker.io/rayproject/ray:2.24.0-py310

FROM ${BASE_IMAGE}
Copy link
Member

Choose a reason for hiding this comment

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

wow, that's very suitable.

.make.defaults Show resolved Hide resolved
Copy link
Member

@roytman roytman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@daw3rd daw3rd left a comment

Choose a reason for hiding this comment

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

@revit13 and I spoke and agreed we will try and simplify things by always publishing the "latest" docker images if a) it is a merge into dev and b) the make test-image passes.
Publishing will be done after make test-image only for dev merges and the tag in this case will be latest. The "releases" will be handled manually (for now?) and publishing will be done out of releases/vX.Y.Z branch. But perhaps this can somehow be automated as well? Maybe not using latest tag?

Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@revit13 revit13 force-pushed the github13 branch 2 times, most recently from a0601c0 to 721b043 Compare July 9, 2024 06:58
Signed-off-by: Revital Sur <eres@il.ibm.com>
@revit13
Copy link
Collaborator Author

revit13 commented Jul 9, 2024

@revit13 and I spoke and agreed we will try and simplify things by always publishing the "latest" docker images if a) it is a merge into dev and b) the make test-image passes. Publishing will be done after make test-image only for dev merges and the tag in this case will be latest. The "releases" will be handled manually (for now?) and publishing will be done out of releases/vX.Y.Z branch. But perhaps this can somehow be automated as well? Maybe not using latest tag?

@daw3rd I changed the action to push as described above. Please let me know if thats OK. I also added a condition to push the images upon creating a new tag which should cover publishing for release. Thanks

Signed-off-by: Revital Sur <eres@il.ibm.com>
transforms/code/code2parquet/ray/Dockerfile Show resolved Hide resolved
.PHONY: .defaults.docker-save-image
.defaults.docker-save-image:
@# Help: Save docker image as tar file to ${ARTIFACTS_DIR} directory.
mkdir -p ${ARTIFACTS_DIR}/
Copy link
Member

Choose a reason for hiding this comment

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

Now that we're trying to add checks, can you add a check for DOCKER_IMAGE_NAME. Maybe this (and others) goes at the top of this file though instead of at each referencing target? I guess its the "global" ones like this that could go at the top of this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Checking DOCKER_IMAGE_NAME in the top of this file results in an error as its is set in the Makefiles that generate Docker images and include .make.defauls, for example in .make.transforms. So I added it to image and publish targets.

.make.versions Show resolved Hide resolved
Copy link
Member

@daw3rd daw3rd left a comment

Choose a reason for hiding this comment

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

lgtm

@daw3rd daw3rd merged commit 2042ced into IBM:dev Jul 10, 2024
21 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