Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Create new Docker publishing workflow. #282

Merged
merged 24 commits into from Dec 18, 2019
Merged

Conversation

cgranade
Copy link
Contributor

This PR sets up a new GitHub Action to prebuild the Docker image for the samples repo and publish it to the packages feed for this repo.

@cgranade cgranade requested a review from anpaz December 17, 2019 18:01
@cgranade
Copy link
Contributor Author

So the infrastructure for this works out to be pretty straightforward, and seems to work pretty well at getting Docker images from master up. The trouble is that apparently GitHub Package Registry has an undocumented requirement that users log in to docker pull even public packages from public repos (more details at https://github.community/t5/GitHub-Actions/docker-pull-from-public-GitHub-Package-Registry-fail-with-quot/td-p/32782). This means that the new images deploy correctly, but are difficult or impossible to use with remote development, VS Online, or Binder. Since those are our three biggest usecases, I will work to explore other solutions.

+@anpaz-msft

Copy link
Member

@anpaz anpaz left a comment

Choose a reason for hiding this comment

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

A couple of minor comments, but overall looks great.

Dockerfile Outdated
FROM mcr.microsoft.com/quantum/iqsharp-base:0.10.1912.501
# This uses the latest Docker image built from the samples repository,
# defined by the Dockerfile in Build/images/samples.
FROM docker.pkg.github.com/microsoft/quantum/samples:latest

# Mark that this Dockerfile is used with the samples repository.
ENV IQSHARP_HOSTING_ENV=SAMPLES_DOCKERFILE
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should have different values for both, maybe this one should be SAMPLES_HOSTED?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, easy enough to change, yeah.

- name: Build and push Docker image
run: |
$Now = [DateTime]::Now;
$ImageTag = "{0}{1:d2}{2:d2}.{3:d2}{4:d2}.{5:d2}{6:d4}" -f $Now.Year, $Now.Month, $Now.Day, $Now.Hour, $Now.Minute, $Now.Second, $Now.Millisecond
Copy link
Member

Choose a reason for hiding this comment

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

would it be better to use the commit id?

@cgranade cgranade marked this pull request as ready for review December 17, 2019 23:01
@cgranade cgranade merged commit eb5d9a0 into master Dec 18, 2019
@cgranade cgranade deleted the cgranade/prebuild-docker branch December 18, 2019 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants