-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
[test] |
.make/Makefile.deploy.prow
Outdated
$(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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
cluster/hook-template.yaml
Outdated
@@ -42,7 +42,7 @@ objects: | |||
terminationGracePeriodSeconds: 180 | |||
containers: | |||
- name: hook | |||
image: ${REGISTRY}/${DOCKER_REPO}/hook:${IMAGE_TAG} | |||
image: ${REGISTRY}/${DOCKER_REPO}-hook:${IMAGE_TAG} |
There was a problem hiding this comment.
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?
.make/Makefile.deploy.prow
Outdated
$(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) |
There was a problem hiding this comment.
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.
@jmelis can you please verify this PR mainly from the centos-ci publishing point of view? |
.make/Makefile.deploy.prow
Outdated
$(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)/$(IMG_REPO)/$(OC_PROJECT_NAME)-hook -f $(DEPLOY_DOCKERFILE) . | ||
$(DOCKER) tag $(REGISTRY)/$(IMG_REPO)-hook $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-hook:$(TAG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't $(REGISTRY)/$(IMG_REPO)-hook
be $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-hook
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so too.
cico_setup.sh
Outdated
@@ -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 "(IMG_REPO_TAG_LEN|IMG_REPO_USERNAME|IMG_REPO_PASSWORD|JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know from where DEVSHIFT_*
is coming. Might be env variable of Centos-CI. Can you make sure we are doing the right thing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, DEVSHIFT_USERNAME
and DEVSHIFT_PASSWORD
are coming from CentOS-CI, however if migrating to quay, we should be using QUAY_USERNAME
and QUAY_PASSWORD
instead. Can you gobally replace DEVSHIFT_USERNAME
and DEVSHIFT_PASSWORD
with their quay
counterparts? also, please keep DEVSHIFT_TAG_LEN
as is, that's a special variable that contains the expected length of git commit hash and can't be renamed.
Also, I recommend you to no longer use such a mechanism to load the env, but rather use this:
function load_jenkins_vars() {
if [ -e "jenkins-env.json" ]; then
eval "$(./env-toolkit load -f jenkins-env.json \
DEVSHIFT_TAG_LEN \
QUAY_USERNAME \
QUAY_PASSWORD \
JENKINS_URL \
GIT_BRANCH \
GIT_COMMIT \
BUILD_NUMBER \
ghprbSourceBranch \
ghprbActualCommit \
BUILD_URL \
ghprbPullId)"
fi
}
It's a much safer approach as it's resilient to env vars with spaces, newlines and special chars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few comments but the most important one is that there are two kind of quay repos, the public ones, and the private ones.
We are going to be building both CentOS based and RHEL based containers, and it's important to ensure that RHEL based containers are not pushed to public repos.
If it's a CentOS container it should be pushed to: $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-$<
, but if it's a rhel container, it should be pushed to $(REGISTRY)/$(IMG_REPO)/rhel-$(OC_PROJECT_NAME)-$<
and I don't see this logic anywhere.
You need to check for the TARGET
env variable and check if $TARGET = rhel
or not.
cico_setup.sh
Outdated
@@ -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 "(IMG_REPO_TAG_LEN|IMG_REPO_USERNAME|IMG_REPO_PASSWORD|JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, DEVSHIFT_USERNAME
and DEVSHIFT_PASSWORD
are coming from CentOS-CI, however if migrating to quay, we should be using QUAY_USERNAME
and QUAY_PASSWORD
instead. Can you gobally replace DEVSHIFT_USERNAME
and DEVSHIFT_PASSWORD
with their quay
counterparts? also, please keep DEVSHIFT_TAG_LEN
as is, that's a special variable that contains the expected length of git commit hash and can't be renamed.
Also, I recommend you to no longer use such a mechanism to load the env, but rather use this:
function load_jenkins_vars() {
if [ -e "jenkins-env.json" ]; then
eval "$(./env-toolkit load -f jenkins-env.json \
DEVSHIFT_TAG_LEN \
QUAY_USERNAME \
QUAY_PASSWORD \
JENKINS_URL \
GIT_BRANCH \
GIT_COMMIT \
BUILD_NUMBER \
ghprbSourceBranch \
ghprbActualCommit \
BUILD_URL \
ghprbPullId)"
fi
}
It's a much safer approach as it's resilient to env vars with spaces, newlines and special chars.
cico_setup.sh
Outdated
if [ -n "${DEVSHIFT_USERNAME}" -a -n "${DEVSHIFT_PASSWORD}" ]; then | ||
docker login -u ${DEVSHIFT_USERNAME} -p ${DEVSHIFT_PASSWORD} ${REGISTRY} | ||
if [ -n "${IMG_REPO_USERNAME}" -a -n "${IMG_REPO_PASSWORD}" ]; then | ||
docker login -u ${IMG_REPO_USERNAME} -p ${IMG_REPO_PASSWORD} ${REGISTRY} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please replace with QUAY_...
.make/Makefile.deploy.prow
Outdated
$(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)/$(IMG_REPO)/$(OC_PROJECT_NAME)-hook -f $(DEPLOY_DOCKERFILE) . | ||
$(DOCKER) tag $(REGISTRY)/$(IMG_REPO)-hook $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-hook:$(TAG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so too.
236a9a9
to
d29bd18
Compare
Here, we check if the @jmelis @bartoszmajsak, correct me if this is incorrect and we need to explictly check for the |
Thanks @jmelis @bartoszmajsak for your review. I have incorporated the suggested changes. |
[test] |
.make/Makefile.deploy.prow
Outdated
$(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)/$(IMG_REPO)/$(OC_PROJECT_NAME)-$< -f $(DEPLOY_DOCKERFILE) . | ||
$(DOCKER) tag $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-$< $(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-$<:$(TAG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something or does the combination of:
https://github.com/arquillian/ike-prow-plugins/pull/218/files#diff-66536a55e28a60c7e24d2d4a43a8b89cR64
export IMG_REPO="openshiftio/rhel-"
with
$(REGISTRY)/$(IMG_REPO)/$(OC_PROJECT_NAME)-$<
results in
quay.io/openshiftio/rhel-/ike-prow-plugins-test-keeper
which is not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MatousJobanek, you are correct. This is incorrect here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MatousJobanek, you are correct. This is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemanik Is there a fix coming for it though? I can't see updates and would love to close this off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartoszmajsak, will update it.
The plugins and hook services are migrated to the new Quay registry - specifically https://quay.io/organization/openshiftio.
The new repositories for the same are as follows:
CentOS containers:
https://quay.io/openshiftio/ike-prow-plugins-hook
https://quay.io/openshiftio/ike-prow-plugins-test-keeper
https://quay.io/openshiftio/ike-prow-plugins-pr-sanitizer
https://quay.io/openshiftio/ike-prow-plugins-work-in-progress
RHEL containers:
https://quay.io/openshiftio/rhel-ike-prow-plugins-hook
https://quay.io/openshiftio/rhel-ike-prow-plugins-test-keeper
https://quay.io/openshiftio/rhel-ike-prow-plugins-pr-sanitizer
https://quay.io/openshiftio/rhel-ike-prow-plugins-work-in-progress
Fixes: #199