Skip to content

Commit

Permalink
add conitionals to pass in ubi7 and ubi8
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Sep 30, 2019
1 parent 13f2d22 commit 6a6ec80
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 21 deletions.
24 changes: 18 additions & 6 deletions ci/dockerfiles/ansible-e2e-hybrid.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@ 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-8.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python3-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 \
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
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.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 python36-pip; fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then python3-pip; fi

# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
RUN 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 \
Expand Down
24 changes: 18 additions & 6 deletions ci/dockerfiles/ansible.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,24 @@ 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-8.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python3-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 \
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
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.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 python36-pip; fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then python3-pip; fi

# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
RUN 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 \
Expand Down
15 changes: 12 additions & 3 deletions ci/tests/e2e-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ test_operator() {
exit 1
fi

# todo: remove 7 after the ci prow upgrade
# 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/ubi8/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/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done"
&& ! 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 @@ -80,8 +83,11 @@ test_operator() {
exit 1
fi

# todo: remove 7 after the ci prow upgrade
# 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/ubi8/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/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done";
&& ! 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 @@ -101,8 +107,11 @@ test_operator() {
exit 1
fi

# todo: remove 7 after the ci prow upgrade
# verify that metrics reflect cr creation
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';
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';
&& ! 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
24 changes: 18 additions & 6 deletions internal/pkg/scaffold/ansible/dockerfilehybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,24 @@ 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-8.noarch.rpm || true) \
&& yum -y update \
&& yum install -y python36-devel python3-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 \
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
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then (yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.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 python36-pip; fi
# ubi8
RUN if $(cat /etc/redhat-release | grep --quiet 'release 8'); then python3-pip; fi
# Install inotify-tools. Note: rpm -i will install the rpm in the registry for allow yum install it.
RUN 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 \
Expand Down

0 comments on commit 6a6ec80

Please sign in to comment.