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

Publish Quickstart images to ghcr #571

Merged
merged 5 commits into from
Mar 8, 2022
Merged

Publish Quickstart images to ghcr #571

merged 5 commits into from
Mar 8, 2022

Conversation

tanvigour
Copy link
Contributor

Signed-off-by: tanvigour tanvi.gour@gmail.com

Description

Please explain the changes you've made

Issue reference

We strive to have all PRs being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #567

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • The quickstart code compiles correctly
  • You've tested new builds of the quickstart if you changed quickstart code
  • You've updated the quickstart's README if necessary
  • If you have changed the steps for a quickstart be sure that you have updated the automated validation accordingly. All of our quickstarts have annotations that allow them to be executed automatically as code. For more information see mechanical-markdown. For user guide with examples see Examples.

Signed-off-by: tanvigour <tanvi.gour@gmail.com>
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker images to GitHub container registry
if: matrix.target_os != 'darwin'
Copy link
Member

Choose a reason for hiding this comment

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

Tanvi, this change does not make sense because it is cloning all the workflow from dapr/dapr. We need to change the current quickstart workflow to do a push to GHCR in addition to Docker Hub. The change is probably much smaller.

Copy link
Contributor

Choose a reason for hiding this comment

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

@artursouza As discussed earlier, In case of Docker we publish quickstarts images to a different repository than Dapr-

SAMPLE_REGISTRY ?= docker.io/dapriosamples

With this PR, quickstarts images also will be published at the same place as Dapr components.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, they will. We just add them under /samples folder. I talked to @yaron2 about that already. This PR, on the other hand, does not work at all for quickstarts.

popd
done
echo "Build docker image and push image..."
make docker-push TARGET_OS=${{ matrix.target_os }} TARGET_ARCH=${{ matrix.target_arch }} DAPR_REGISTRY=ghcr.io/${{ github.repository_owner }} DAPR_TAG=${{ env.REL_VERSION }}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can check this file for what make command we already have for pushing images.

# ------------------------------------------------------------

make docker-push is not here I guess. We can think of adding docker-push or reuse what we have already.
Overall flow would look like this -

  1. Build docker images - Already being done
  2. Docker login - Already being done
  3. ghcr login - It is added in this PR
  4. push images to docker - Already being done
  5. push images to ghcr - We only need to add this.

We can combine 4 & 5 together or keep it separate.

Copy link
Contributor

@paulyuk paulyuk left a comment

Choose a reason for hiding this comment

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

@tanvigour and @artursouza the docker images I'm most worried about are the ones referenced in compose file for kafka and zookeeper. Are we porting these two aimages to GHCR also for the sake of test stability? https://github.com/dapr/quickstarts/blob/master/bindings/docker-compose-single-kafka.yml#L8

@tanvigour
Copy link
Contributor Author

@tanvigour and @artursouza the docker images I'm most worried about are the ones referenced in compose file for kafka and zookeeper. Are we porting these two aimages to GHCR also for the sake of test stability? https://github.com/dapr/quickstarts/blob/master/bindings/docker-compose-single-kafka.yml#L8

@artursouza what do you think?

@artursouza
Copy link
Member

@tanvigour and @artursouza the docker images I'm most worried about are the ones referenced in compose file for kafka and zookeeper. Are we porting these two aimages to GHCR also for the sake of test stability? https://github.com/dapr/quickstarts/blob/master/bindings/docker-compose-single-kafka.yml#L8

@artursouza what do you think?

We can put those under the samples/3rdparty/ folder, this way we can also pull them from there.

tanvigour and others added 2 commits March 7, 2022 19:24
for sample in "${SAMPLE_LIST[@]}"; do
echo "Push image for ${sample}..."
pushd ${sample}
make push
popd
done
- name: GitHub container registry login
if: matrix.target_os != 'darwin' && github.event_name != 'pull_request'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but do we need this OS check?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. We don't want to publish the image per OS build.

Signed-off-by: tanvigour <tanvi.gour@gmail.com>
docker.mk Outdated
@@ -6,6 +6,7 @@
# Common make targets for samples' Docker images.

SAMPLE_REGISTRY ?= docker.io/dapriosamples
GHRC_REGISTRY ?= ghrc.io/dapr/samples
Copy link
Member

Choose a reason for hiding this comment

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

We can revert the changes in this file and simply set SAMPLE_REGISTRY=ghrc.io/dapr/samples in the workflow and reuse the existing make targets.

Signed-off-by: tanvigour <tanvi.gour@gmail.com>
@artursouza artursouza merged commit 406f06a into dapr:master Mar 8, 2022
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.

Publish the quickstart (tutorial) app images to GHCR
5 participants