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

chore(#199): migrate from devshift registry to quay.io #218

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
16 changes: 8 additions & 8 deletions .make/Makefile.deploy.prow
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ build-hook: update

.PHONY: build-hook-image
build-hook-image:
$(DOCKER) build --build-arg BINARY=hook -t $(REGISTRY)/$(DOCKER_REPO)/hook -f $(DEPLOY_DOCKERFILE) .
$(DOCKER) tag $(REGISTRY)/$(DOCKER_REPO)/hook $(REGISTRY)/$(DOCKER_REPO)/hook:$(TAG)
$(DOCKER) build --build-arg BINARY=hook -t $(REGISTRY)/$(DOCKER_REPO)-hook -f $(DEPLOY_DOCKERFILE) .
$(DOCKER) tag $(REGISTRY)/$(DOCKER_REPO)-hook $(REGISTRY)/$(DOCKER_REPO)-hook:$(TAG)
Copy link
Member

Choose a reason for hiding this comment

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

Why is it - instead of / now?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can also change DOCKER_REPO -> IMG_REPO?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it changed from prod.registry.devshift.net/osio-prod/ike-prow-plugins/test-keeper to quay.io/openshiftio/ike-prow-plugins-test-keeper as per the new repositories.

Here's the discussion - https://chat.openshift.io/developers/pl/tqzbcjx5f3nmdg7co9fn5kay5a

Copy link
Member

@bartoszmajsak bartoszmajsak Jul 2, 2018

Choose a reason for hiding this comment

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

Thanks for the link. In such a case I think we should improve the naming here, as $(REGISTRY)/$(DOCKER_REPO)-hook is not really correct.

In our case this should be:

quay.io/openshiftio/rhel-ike-prow-plugins-work-in-progress

so

  • REGISTRY = quay.io
  • IMG_REPO = openshiftio
  • ike-prow-plugins- is a prefix of the plugin image name in such case.


.PHONY: push-hook-image
push-hook-image: build-hook-image
$(DOCKER) push $(REGISTRY)/$(DOCKER_REPO)/hook
$(DOCKER) push $(REGISTRY)/$(DOCKER_REPO)-hook

.PHONY: clean-hook-image
clean-hook-image:
$(DOCKER) rmi -f $(REGISTRY)/$(DOCKER_REPO)/hook
$(DOCKER) rmi -f $(REGISTRY)/$(DOCKER_REPO)-hook

.PHONY: oc-deploy-plugins ## Builds plugin images, updates configuration and deploys new version of ike-plugins
oc-deploy-plugins: oc-init-project compile deploy-plugins oc-generate-deployments
Expand All @@ -54,16 +54,16 @@ deploy-plugins: build-plugin-images push-plugin-images
.PHONY: build-plugin-images $(PLUGINS)
build-plugin-images: $(BUILD_IMAGES)
$(BUILD_IMAGES): build-%: %
$(DOCKER) build --build-arg BINARY=$< -t $(REGISTRY)/$(DOCKER_REPO)/$< -f $(DEPLOY_DOCKERFILE) .
$(DOCKER) tag $(REGISTRY)/$(DOCKER_REPO)/$< $(REGISTRY)/$(DOCKER_REPO)/$<:$(TAG)
$(DOCKER) build --build-arg BINARY=$< -t $(REGISTRY)/$(DOCKER_REPO)-$< -f $(DEPLOY_DOCKERFILE) .
$(DOCKER) tag $(REGISTRY)/$(DOCKER_REPO)/$< $(REGISTRY)/$(DOCKER_REPO)-$<:$(TAG)


.PHONY: clean-plugin-images
clean-plugin-images: $(CLEAN_IMAGES)
$(CLEAN_IMAGES): clean-%: %
$(DOCKER) rmi -f $(REGISTRY)/$(DOCKER_REPO)/$<
$(DOCKER) rmi -f $(REGISTRY)/$(DOCKER_REPO)-$<

.PHONY: push-plugin-images
push-plugin-images: build-plugin-images $(PUSH_IMAGES)
$(PUSH_IMAGES): push-%: %
$(DOCKER) push $(REGISTRY)/$(DOCKER_REPO)/$<
$(DOCKER) push $(REGISTRY)/$(DOCKER_REPO)-$<
2 changes: 1 addition & 1 deletion Dockerfile.deploy.rhel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM prod.registry.devshift.net/osio-prod/base/pcp-tools:latest
FROM quay.io/openshiftio/rhel-base-pcp-tools:latest

LABEL maintainer="Devtools <[email protected]>"
LABEL maintainer="Devtools-test <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BINARY_DIR:=${PWD}/bin
CLUSTER_DIR?=${PWD}/cluster
PLUGIN_DEPLOYMENTS_DIR?=$(CLUSTER_DIR)/generated

REGISTRY?=docker.io
REGISTRY?=quay.io
DOCKER_REPO?=ike-prow-plugins
BUILD_IMAGES:=$(patsubst %,build-%, $(PLUGINS))
PUSH_IMAGES:=$(patsubst %,push-%, $(PLUGINS))
Expand Down
10 changes: 5 additions & 5 deletions cico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e
function load_jenkins_vars() {
if [ -e "jenkins-env" ]; then
cat jenkins-env \
| grep -E "(DEVSHIFT_TAG_LEN|DEVSHIFT_USERNAME|DEVSHIFT_PASSWORD|JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \
| grep -E "(DEVSHIFT_TAG_LEN|QUAY_USERNAME|QUAY_PASSWORD|JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \
| sed 's/^/export /g' \
> ~/.jenkins-env
source ~/.jenkins-env
Expand Down Expand Up @@ -49,17 +49,17 @@ function cleanup_env {
}

function deploy() {
export REGISTRY="push.registry.devshift.net"
export REGISTRY="quay.io"
export PLUGINS='work-in-progress test-keeper pr-sanitizer'

if [ "${TARGET}" = "rhel" ]; then
export DEPLOY_DOCKERFILE='Dockerfile.deploy.rhel'
export DOCKER_REPO="osio-prod/ike-prow-plugins"
export DOCKER_REPO="openshiftio/rhel-ike-prow-plugins"
fi

# Login first
if [ -n "${DEVSHIFT_USERNAME}" -a -n "${DEVSHIFT_PASSWORD}" ]; then
docker login -u ${DEVSHIFT_USERNAME} -p ${DEVSHIFT_PASSWORD} ${REGISTRY}
if [ -n "${QUAY_USERNAME}" -a -n "${QUAY_PASSWORD}" ]; then
docker login -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD} ${REGISTRY}
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest using IMG_REPO prefix instead of QUAY. This will then have a proper meaning for any repo we use.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea for IMG_REPO but it's difficult for QUAY_USERNAME and QUAY_PASSWORD. Note that this come directly from credentials in CICO, so if we want to rename them, we should do it in these scripts.

else
echo "Could not login, missing credentials for the registry"
fi
Expand Down
6 changes: 3 additions & 3 deletions cluster/hook-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ apiVersion: v1
parameters:
- name: REGISTRY
required: true
value: docker.io
value: quay.io
- name: DOCKER_REPO
required: true
value: arquillian
value: openshiftio
- name: IMAGE_TAG
required: true
value: latest
Expand Down Expand Up @@ -42,7 +42,7 @@ objects:
terminationGracePeriodSeconds: 180
containers:
- name: hook
image: ${REGISTRY}/${DOCKER_REPO}/hook:${IMAGE_TAG}
image: ${REGISTRY}/${DOCKER_REPO}-hook:${IMAGE_TAG}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is correct now. What is the value here for the generated yaml file?

imagePullPolicy: Always
resources:
requests:
Expand Down
6 changes: 3 additions & 3 deletions cluster/ike-prow-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ apiVersion: v1
parameters:
- name: REGISTRY
required: true
value: docker.io
value: quay.io
- name: DOCKER_REPO
required: true
value: arquillian
value: openshiftio
- name: PLUGIN_NAME
required: true
- name: IMAGE_TAG
Expand Down Expand Up @@ -42,7 +42,7 @@ objects:
terminationGracePeriodSeconds: 180
containers:
- name: ${PLUGIN_NAME}
image: ${REGISTRY}/${DOCKER_REPO}/${PLUGIN_NAME}:${IMAGE_TAG}
image: ${REGISTRY}/${DOCKER_REPO}-${PLUGIN_NAME}:${IMAGE_TAG}
imagePullPolicy: Always
resources:
requests:
Expand Down