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

Use cron jobs from Circleci to trigger Docker Hub builds #312

Closed
wants to merge 9 commits into from
Closed

Use cron jobs from Circleci to trigger Docker Hub builds #312

wants to merge 9 commits into from

Conversation

ruffsl
Copy link
Member

@ruffsl ruffsl commented Aug 27, 2019

It seems like the server hosting the cron jobs for triggering Docker Hub builds keeps going AWOL.
I'd like to add some reliability and transparency to this task so we can keep tabs on it here in the repo.

This simply add a CircleCI config to trigger the osrf/ros2 night tags every night,
and the devel tag every day, as to spread out the build queue on docker hub.
It also triggers to build both if any changes are made to the repo.

image

Copy link
Member

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

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

I'm not familiar with Circle CI's yaml format but assuming that this does what it looks like it does, LGTM.

command: |
curl --request POST \
--header "Content-Type: application/json" \
--data << parameters.data >> \
Copy link
Member

Choose a reason for hiding this comment

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

Are these parameters masked out of the build log and is the build log public or just the build status?

Copy link
Member Author

Choose a reason for hiding this comment

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

The build logs are public for public repos, but environment variables are not expanded prior to logging the contents of the run script, nor is the token printed to stdout by the return message from the POST request. I'm not sure CircleCI masks secrets yet, it was a requested feature last I checked. But that won't be an issue here. Example:
https://circleci.com/gh/ruffsl/docker_images/23

@ruffsl
Copy link
Member Author

ruffsl commented Aug 27, 2019

@nuclearsandwich , I don't have admin to the org, so if you could click "Set Up Project" for this repo:
https://circleci.com/add-projects/gh/osrf

I've already added the necessary context on CircleCI, so after the setup above, we can merge to check the CI trigger is working. Then I'll disable the workflow on my fork, and you can check the old cron jobs are disabled to avoid duplicate retriggers.

To avoid leaking envs set in Docker Hub repo
from the return json POST reply.
@tfoote
Copy link
Contributor

tfoote commented Sep 11, 2019

One question is that if we already have travis builds integrated. Why not use their cron functionality instead of relying on/integrating another provider?

https://docs.travis-ci.com/user/cron-jobs/

@ruffsl
Copy link
Member Author

ruffsl commented Sep 11, 2019

One question is that if we already have travis builds integrated. Why not use their cron functionality instead of relying on/integrating another provider?

I don't think travis has a way to create a cron job for a individual workflow. It's sort of all or nothing, and as our current docker build PR bot is using that as a trigger to check all tracked dockerfile, I didn't want to disrupt or refactor it to be cron job aware. Did travis add features for workflow selection?

@tfoote
Copy link
Contributor

tfoote commented Sep 16, 2019

If there's a reason that's fine. I just want to make sure that we're consciously choosing to add another integration.

@ruffsl
Copy link
Member Author

ruffsl commented Oct 19, 2019

@nuclearsandwich or @tfoote , could you enable circleci for this repo now?

Additionally, sence DockerHub as deprecated the ability to trigger builds from linked repos that are official images, we may need to use this same cron to keep the desktop tags on osrf/ros update as well.

@mikaelarguedas
Copy link
Contributor

FYI: I triggered the nightly images manually (they didnt get triggered for 20 days). And opened an alternative to this at #348 to get a daily triggered build of those and email notification on failure.

@mikaelarguedas
Copy link
Contributor

Implemented in #348

@mikaelarguedas
Copy link
Contributor

Additionally, sence DockerHub as deprecated the ability to trigger builds from linked repos that are official images, we may need to use this same cron to keep the desktop tags on osrf/ros update as well.

This has been detailed in a new issue #362 (comment)

@ruffsl ruffsl deleted the circleci branch June 12, 2021 02:36
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.

4 participants