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 image workflow #345

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

obasekiosa
Copy link
Contributor

Description

Adds a GitHub action that builds and pushes a docker image of the repository to docker hub
images are tagged with docker_username/repo_name:date

Motivation and Context

This allows for the first step in the CD process.
fixes #306

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@tetron tetron self-requested a review August 16, 2021 16:09
cd-build.yml Outdated Show resolved Hide resolved
Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

I think this workflow is duplicating the work of ci-build.yml, with the additional step (the only difference?) for uploading an image to GH's Docker registry.

From what I understood, the image will be built for each change done to the main branch. But the image won't have the commit hash, instead if will use the date of the job that generated the change.

I think instead we could:

  • push the image manually when necessary specifying the version?
  • or push it with the commit hash instead of the date only? Or a combination of both?
  • remove the duplicated build process, and build this one only if the build has succeeded? (I think that's doable in GH actions)

.github/workflows/cd-build.yml Outdated Show resolved Hide resolved
.github/workflows/cd-build.yml Outdated Show resolved Hide resolved
obasekiosa and others added 2 commits October 13, 2021 08:20
workflow now runs only if CWL Viewer Build workflow completes
Comment on lines +22 to +27
DATE=$(date +%s)
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
VERSION= ${GIT_HASH}-${DATE}
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION}
Copy link
Member

@mr-c mr-c Oct 13, 2021

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@obasekiosa let me know if you have questions

Copy link
Member

Choose a reason for hiding this comment

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

specifically, I would like this to match the tagging conventions and the --build-arg calls (lines 222 - 227) of https://github.com/common-workflow-language/cwlviewer/pull/360/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R216

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Nothing to add besides +1 on @mr-c 's comment about re-using the build instructions linked. Great job @obasekiosa !

@mr-c
Copy link
Member

mr-c commented Nov 30, 2021

@obasekiosa I see that this workflow is hard to test in a PR. Drop a link here to the working run on your fork, along with a link to the resulting container on your Docker Hub or quay.io account.

Of course, let me know if you have any questions, we can even have a voice chat with screen sharing to troubleshoot any problems that arise.

run: |
DATE=$(date +%s)
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
VERSION= ${GIT_HASH}-${DATE}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VERSION= ${GIT_HASH}-${DATE}
VERSION=${GIT_HASH}-${DATE}

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.

Upgrade cwltool version to something from 2021
4 participants