hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Request: Docker Registry #228

Closed danieldn closed 4 years ago

danieldn commented 5 years ago

Summary

See resource request https://docs.google.com/document/d/1GCn1Egja-BcLiynhOPMafNPKd0et96GZOvuxIIB5G7c/edit#

Impact

Resource request

Tasks

Definition of Done

Hacko developers should be able to push and pull images to registry

danieldn commented 5 years ago

Update: @MikeTheCanuck emailed Docker to recover Hackoregon namespace on Docker Hub. Likely will go through (do not surrender mike!)

MikeTheCanuck commented 5 years ago

cf. there's an existing Docker user named hackoregon that some well-meaning soul created back in the dark days of 2016: https://hub.docker.com/u/hackoregon

MikeTheCanuck commented 5 years ago

And we now have access to the "Hackoregoncivic" organization on Docker Hub: https://cloud.docker.com/orgs/hackoregoncivic/teams?page=1&page_size=10

@danieldn has been granted Owners access here so we now have two active Hacko'ers who can help manage this

MikeTheCanuck commented 5 years ago

Q for @BrianHGrant - under what well-known, durable name should we create a repo? e.g.

How many containers are we expecting to publish to start? That's the number of Docker hub repos we'll need.

bhgrant8 commented 5 years ago

@MikeTheCanuck , I agree getting away from time semantic naming conventions is good, as time can be part of our versioning.

As we are now including "hackoregoncivic" in namespace, is "backend-docker" enough?

We can do "backend-docker-django" vs. "backend-docker-node" or something like that, not sure if "template" would really be necessary.

When folks pull the image, it will be "docker pull hackoregoncivic/backend-docker-django:(version or latest)" or included in docker-compose, or what have you. But this should give semantic understanding of what image you are pulling.

With the cookiecutter/application template repo, trying to balance python standards + our org, will open an issue related to this, but it will not have it's own docker image in a dockerhub repo.

Based on conversation with data science lead (Karen Ng) I know of 2 docker images:

both based in python but datascience is conda env, backend is django/web app

bhgrant8 commented 5 years ago

For backend, let's qualify the above with a development repo and production repo:

backend-docker-django-dev
backend-docker-django

Development as in development of the docker image itself, vs. development API project.

bhgrant8 commented 5 years ago

adding @karenng-civicsoftware

MikeTheCanuck commented 5 years ago

Alright, let's see what's needed to make this scheme operational. I've created the first repo hackoregoncivic/backend-docker-django-dev in our hackoregoncivic Docker Hub org. It reports this approach to push a new image to the repo:

docker tag local-image:tagname reponame:tagname
docker push reponame:tagname

I can a few necessary next steps ahead of us:

bhgrant8 commented 5 years ago

Thanks!

bhgrant8 commented 5 years ago

Backend is successfully deploying docker image to hackoregoncivic repo, using the deployer credentials: https://github.com/hackoregon/2019-backend-docker/tree/staging and this repo: https://cloud.docker.com/u/hackoregoncivic/repository/docker/hackoregoncivic/backend-docker-django-dev

will deploy to master, once we confirm any outstanding issues.

using travis: https://github.com/hackoregon/2019-backend-docker/blob/staging/.travis.yml

and docker-deploy script: https://github.com/hackoregon/2019-backend-docker/blob/staging/bin/docker-deploy.sh

which does a branch based deploy to a staging repo, to be able to pull from repo and test a project, prior to deploying master image which will go to a non -dev tagged repo. All developers will use the non-dev tagged repo for both development and production

we will not link repo in dockerhub, as we are using travis to deploy vs. the docker "autobuild"

integration to 2019 projects will come via DOCKERFILE in the cookiecutter repo:

https://github.com/hackoregon/2019-backend-cookiecutter-django/blob/test-docker/%7B%7Bcookiecutter.github_repo%7D%7D/DOCKERFILE

generally this maybe complete?

nam20485 commented 5 years ago

Apparently GitHub has a Docker registry now: https://github.com/features/package-registry.

Or at least will soon.

Using this option may ease the authentication method.