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 docker-image workflow #5966

Merged
merged 2 commits into from
Jul 11, 2022
Merged

Add docker-image workflow #5966

merged 2 commits into from
Jul 11, 2022

Conversation

symeneses
Copy link
Contributor

What is this PR about?
It solves #5939

It add a workflow docker-image, The workflow get the labels and tags, build the image, test it and push it to Docker Hub. The workflow will be triggered when there are new releases.

It's needed to have the secrets with the Docker Hub user DOCKERHUB_USER and token DOCKERHUB_TOKEN.

The workflow was tested using act. The test image is in a test image where you can see the tags (latest and version) created. These tags can be modified if needed.

#DataUmbrellaPyMCSprint

...

Checklist

@codecov
Copy link

codecov bot commented Jul 10, 2022

Codecov Report

Merging #5966 (39fbf57) into main (e7d0607) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5966      +/-   ##
==========================================
- Coverage   89.42%   89.38%   -0.04%     
==========================================
  Files          73       73              
  Lines       13292    13249      -43     
==========================================
- Hits        11886    11843      -43     
  Misses       1406     1406              
Impacted Files Coverage Δ
pymc/distributions/continuous.py 97.89% <0.00%> (-0.10%) ⬇️
pymc/ode/ode.py 85.85% <0.00%> (ø)
pymc/ode/__init__.py 100.00% <0.00%> (ø)

@michaelosthege
Copy link
Member

To test this, we should (temporarily) change the trigger condition to

on:
  push:

...and turn off actually pushing it.
I believe this is covered by the example here? https://github.com/docker/build-push-action#git-context

They also write that the checkout action is not needed, because the docker/build-and-push action does a git checkout automatically?

In the meantime I'll try to figure out who knows our DOCKERHUB_USER and DOCKERHUB_TOKEN, because they are not yet set as repository secrets.

@michaelosthege
Copy link
Member

The workflow was tested using act. The test image is in a test image where you can see the tags (latest and version) created. These tags can be modified if needed.

The image appears to be private? It's asking me to log in..

@twiecki
Copy link
Member

twiecki commented Jul 11, 2022

In the meantime I'll try to figure out who knows our DOCKERHUB_USER and DOCKERHUB_TOKEN, because they are not yet set as repository secrets.

I own the docker organization and now created and added these secrets, so this should work now. Can we test it somehow or should we just merge?

@symeneses
Copy link
Contributor Author

symeneses commented Jul 11, 2022

They also write that the checkout action is not needed, because the docker/build-and-push action does a git checkout automatically?

I tested it without the checkout but it failed.

@symeneses
Copy link
Contributor Author

The workflow was tested using act. The test image is in a test image where you can see the tags (latest and version) created. These tags can be modified if needed.

The image appears to be private? It's asking me to log in..

You should be able to see login in with any user. The image looks like this:
Screenshot 2022-07-11 at 11 26 18

@symeneses
Copy link
Contributor Author

In the meantime I'll try to figure out who knows our DOCKERHUB_USER and DOCKERHUB_TOKEN, because they are not yet set as repository secrets.

I own the docker organization and now created and added these secrets, so this should work now. Can we test it somehow or should we just merge?

It can be tested using act executing this command:

act release -j build-container -v

For that I changed the image name name=pymc/pymc to name=symeneses/test. Also, as my laptop is M1, while testing I had to add platforms: linux/x86_64 in the steps Build and load image and Build and push.

@twiecki twiecki merged commit f1140e8 into pymc-devs:main Jul 11, 2022
@twiecki
Copy link
Member

twiecki commented Jul 11, 2022

I'm merging this, we can always keep working on it in follow-up PRs. But will this now trigger a build we can test or do we need to make a release for that?

@symeneses
Copy link
Contributor Author

I'm merging this, we can always keep working on it in follow-up PRs. But will this now trigger a build we can test or do we need to make a release for that?

It will be triggered only by release

@symeneses symeneses deleted the gh-docker-image branch July 12, 2022 06:49
@twiecki
Copy link
Member

twiecki commented Jul 15, 2022

Just cut a new release, let's see!

@twiecki
Copy link
Member

twiecki commented Jul 15, 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.

4 participants