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

Ansible ubi upgrade #1990

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- The Helm operator no longer prints manifest diffs in the operator log at verbosity levels lower than INFO ([#1857](https://github.com/operator-framework/operator-sdk/pull/1857))
- CRD manifest `spec.version` is still supported, but users will see a warning message if `spec.versions` is not present and an error if `spec.versions` is populated but the version in `spec.version` is not in `spec.versions`. ([#1876](https://github.com/operator-framework/operator-sdk/pull/1876))
- Upgrade base image for Go, Helm, and scorecard proxy from `registry.access.redhat.com/ubi7/ubi-minimal:latest` to `registry.access.redhat.com/ubi8/ubi-minimal:latest`. ([#1952](https://github.com/operator-framework/operator-sdk/pull/1952))
- Upgrade base image for Ansible from `registry.access.redhat.com/ubi7/ubi:latest` to `registry.access.redhat.com/ubi8/ubi:latest`. ([#1990](https://github.com/operator-framework/operator-sdk/pull/1990))

### Breaking changes

Expand Down
24 changes: 15 additions & 9 deletions ci/dockerfiles/ansible-e2e-hybrid.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ ENV OPERATOR=/usr/local/bin/ansible-operator \
# Install python dependencies
# Ensure fresh metadata rather than cached metadata in the base by running
# yum clean all && rm -rf /var/yum/cache/* first
RUN yum clean all && rm -rf /var/cache/yum/* \
&& (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python36-pip gcc \
# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
&& curl -O https://rpmfind.net/linux/fedora/linux/releases/30/Everything/x86_64/os/Packages/i/inotify-tools-3.14-16.fc30.x86_64.rpm \
&& rpm -i inotify-tools-3.14-16.fc30.x86_64.rpm \
&& yum install inotify-tools \
&& pip3 install --upgrade setuptools pip \
RUN yum clean all && rm -rf /var/cache/yum/*

# todo; remove ubi7 after CI be updated with images
# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true); fi

RUN yum -y update \
&& yum install -y python36-devel gcc

# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y python36-pip inotify-tools || true); fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y python3-pip inotify3-tools || true); fi

RUN pip3 install --upgrade setuptools pip \
&& pip install --no-cache-dir --ignore-installed ipaddress \
ansible-runner==1.3.4 \
ansible-runner-http==1.0.0 \
Expand Down
24 changes: 15 additions & 9 deletions ci/dockerfiles/ansible.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ ENV OPERATOR=/usr/local/bin/ansible-operator \
# Install python dependencies
# Ensure fresh metadata rather than cached metadata in the base by running
# yum clean all && rm -rf /var/yum/cache/* first
RUN yum clean all && rm -rf /var/cache/yum/* \
&& (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python36-pip gcc \
# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
&& curl -O https://rpmfind.net/linux/fedora/linux/releases/30/Everything/x86_64/os/Packages/i/inotify-tools-3.14-16.fc30.x86_64.rpm \
&& rpm -i inotify-tools-3.14-16.fc30.x86_64.rpm \
&& yum install inotify-tools \
&& pip3 install --upgrade setuptools pip \
RUN yum clean all && rm -rf /var/cache/yum/*

# todo; remove ubi7 after CI be updated with images
# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true); fi

RUN yum -y update \
&& yum install -y python36-devel gcc

# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y python36-pip inotify-tools || true); fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y python3-pip inotify3-tools || true); fi

RUN pip3 install --upgrade setuptools pip \
&& pip install --no-cache-dir --ignore-installed ipaddress \
ansible-runner==1.3.4 \
ansible-runner-http==1.0.0 \
Expand Down
6 changes: 3 additions & 3 deletions ci/tests/e2e-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test_operator() {
fi

# verify that the metrics endpoint exists
if ! timeout 1m bash -c -- "until kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done";
if ! timeout 1m bash -c -- "until kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi8/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done";
then
echo "Failed to verify that metrics endpoint exists"
kubectl describe pods
Expand All @@ -81,7 +81,7 @@ test_operator() {
fi

# verify that the operator metrics endpoint exists
if ! timeout 1m bash -c -- "until kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done";
if ! timeout 1m bash -c -- "until kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi8/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done";
then
echo "Failed to verify that metrics endpoint exists"
kubectl describe pods
Expand All @@ -102,7 +102,7 @@ test_operator() {
fi

# verify that metrics reflect cr creation
if ! bash -c -- 'kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi7/ubi-minimal:latest -- curl http://memcached-operator-metrics:8686/metrics | grep example-memcached';
if ! bash -c -- 'kubectl run -i --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi8/ubi-minimal:latest -- curl http://memcached-operator-metrics:8686/metrics | grep example-memcached';
then
echo "Failed to verify custom resource metrics"
kubectl describe pods
Expand Down
2 changes: 1 addition & 1 deletion doc/sdk-cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ building example-operator...

building container quay.io/example/operator:v0.0.1...
Sending build context to Docker daemon 163.9MB
Step 1/4 : FROM registry.access.redhat.com/ubi7/ubi-minimal:latest
Step 1/4 : FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
---> 77144d8c6bdc
Step 2/4 : ADD tmp/_output/bin/example-operator /usr/local/bin/example-operator
---> 2ada0d6ca93c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ USER 0
# yum clean all && rm -rf /var/yum/cache/* first
RUN yum clean all && rm -rf /var/cache/yum/* \
&& yum -y update \
&& yum install -y python36-devel python36-pip gcc libffi-devel
&& yum install -y python36-devel gcc libffi-devel

# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y python36-pip || true); fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y python3-pip || true); fi

RUN pip3 install --user molecule==2.22

ARG NAMESPACEDMAN
Expand Down
24 changes: 15 additions & 9 deletions internal/pkg/scaffold/ansible/dockerfilehybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,21 @@ ENV OPERATOR=/usr/local/bin/ansible-operator \
# Install python dependencies
# Ensure fresh metadata rather than cached metadata in the base by running
# yum clean all && rm -rf /var/yum/cache/* first
RUN yum clean all && rm -rf /var/cache/yum/* \
&& (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python36-pip gcc \
# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
&& curl -O https://rpmfind.net/linux/fedora/linux/releases/30/Everything/x86_64/os/Packages/i/inotify-tools-3.14-16.fc30.x86_64.rpm \
&& rpm -i inotify-tools-3.14-16.fc30.x86_64.rpm \
&& yum install inotify-tools \
&& pip3 install --upgrade setuptools pip \
RUN yum clean all && rm -rf /var/cache/yum/*

# todo; remove ubi7 after CI be updated with images
# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true); fi

RUN yum -y update \
&& yum install -y python36-devel gcc

# ubi7
RUN if $(cat /etc/redhat-release | grep --quiet 'release 7'); then (yum install -y python36-pip inotify-tools || true); fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y python3-pip inotify3-tools || true); fi

RUN pip3 install --upgrade setuptools pip \
&& pip install --no-cache-dir --ignore-installed ipaddress \
ansible-runner==1.3.4 \
ansible-runner-http==1.0.0 \
Expand Down