Skip to content

Commit

Permalink
52 update rhel version for ammos compatibility (#67)
Browse files Browse the repository at this point in the history
* updated python39 to 3, RHEL8 to RHEL9

* updated ci to use var for know hosts file

* fixing loading modules

* updating ci for RHEL9

* updating  anms-init to rhel9

* installing node rpm directly

---------

Co-authored-by: d-linko <[email protected]>
  • Loading branch information
d-linko and d-linko authored Feb 5, 2024
1 parent b9c71aa commit 25e02a1
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 32 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ __pycache__
coverage.xml
testresults.xml

# local build files
anms-core/build/
anms-ui/release/

# Javascript and ESLint related content to be ignored
node_modules
package-lock.json
Expand Down
14 changes: 7 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

default:
# All jobs run within a target-like environment
image: registry.access.redhat.com/ubi8/ubi:8.6
image: registry.access.redhat.com/ubi9/ubi:9.2

include:
# Run pipeline only on branches, not MRs
Expand Down Expand Up @@ -61,7 +61,7 @@ stages:
update-ca-trust # to /etc/pki/tls/certs/ca-bundle.crt

.prep-install-python: &prep-install-python |
dnf install -y python39 python39-pip python39-wheel
dnf install -y python3 python3-pip python3-wheel
dnf clean all && rm -rf /var/cache/yum
pip3 install --upgrade pip pip-tools && ln -s pip3 /usr/bin/pip

Expand All @@ -82,7 +82,7 @@ stages:
docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY

.prep-install-compose: &prep-install-compose |
dnf install -y python39 python39-pip python39-wheel
dnf install -y python3 python3-pip python3-wheel
pip3 install docker-compose
docker-compose version

Expand Down Expand Up @@ -346,13 +346,13 @@ deploy:
- dnf install -y hostname
- ./build.sh push
- |
dnf install -y https://yum.puppet.com/puppet-release-el-8.noarch.rpm
dnf install -y https://yum.puppet.com/puppet-tools-release-el-8.noarch.rpm
dnf install -y puppet-agent-7.24.0-1.el8 puppet-bolt
dnf install -y https://yum.puppet.com/puppet-release-el-9.noarch.rpm
dnf install -y https://yum.puppet.com/puppet-tools-release-el-9.noarch.rpm
dnf install -y puppet-agent-7.28.0-1.el9 puppet-bolt
update-alternatives --install /usr/bin/puppet puppet-agent /opt/puppetlabs/bin/puppet 10
- chmod +t /tmp # workaround ruby need within prep.sh
- ./puppet/prep.sh
- mkdir -p $HOME/.ssh && cat apl-known-hosts.txt >>$HOME/.ssh/known_hosts
- mkdir -p $HOME/.ssh && cat $KNOWN_HOSTS >>$HOME/.ssh/known_hosts
- |-
ANMS_VERSION="$(git describe --always --tags --dirty) on ${CI_COMMIT_REF_NAME}"
mkdir -p puppet/data/fqdn/
Expand Down
2 changes: 1 addition & 1 deletion anms-core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ COPY pyproject.toml ${APP_WORK_DIR}/
RUN --mount=type=cache,target=/root/.cache/pip \
cd ${APP_WORK_DIR} && \
pip-compile --find-links ${PY_WHEEL_DIR} pyproject.toml && \
pip3 install -r requirements.txt
pip3 install --ignore-installed -r requirements.txt
# Actual main package
COPY anms ${APP_WORK_DIR}/anms
RUN --mount=type=cache,target=/root/.cache/pip \
Expand Down
2 changes: 1 addition & 1 deletion anms-core/integration_test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
## the prime contract 80NM0018D0004 between the Caltech and NASA under
## subcontract 1658085.
##
FROM registry.access.redhat.com/ubi8/ubi:8.6
FROM registry.access.redhat.com/ubi9/ubi:9.2

# Optional APL network configuration from
# https://aplprod.servicenowservices.com/sp?id=kb_article&sys_id=c0de6fe91b83d85071b143bae54bcb34
Expand Down
3 changes: 2 additions & 1 deletion anms-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ENV NODE_OPTIONS=--use-openssl-ca

# Install System Level Dependencies
# Yarn cannot be installed via RPM because of FIPS-mode restrictions
RUN dnf -y module install nodejs:16 && \
RUN dnf -y install https://rpm.nodesource.com/pub_16.x/el/9/x86_64/nodesource-release-el9-1.noarch.rpm && \
dnf -y install nodejs && \
dnf clean all && rm -rf /var/cache/yum && \
npm install --global yarn && \
yarn config set --global cafile ${PIP_CERT}
Expand Down
2 changes: 1 addition & 1 deletion anms-ui/check_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
##

# Update yarn lockfiles from current package versions.
# On RHEL8 the prerequites are:
# On RHEL9 the prerequites are:
# dnf -y module install nodejs:16
# npm install --global yarn
#
Expand Down
3 changes: 1 addition & 2 deletions authnz-emu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
FROM anms-base

# Install Apache
RUN dnf -y module install httpd:2.4 && \
dnf -y install httpd-tools mod_ssl mod_session
RUN dnf -y install httpd-tools mod_ssl mod_session

# Update Apache Configuration
COPY httpd.conf /etc/httpd/conf/httpd.conf
Expand Down
4 changes: 2 additions & 2 deletions authnz-emu/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ LoadModule ssl_module modules/mod_ssl.so
#LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
#LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
#LoadModule dialup_module modules/mod_dialup.so
LoadModule http2_module modules/mod_http2.so
LoadModule proxy_http2_module modules/mod_proxy_http2.so
#LoadModule http2_module modules/mod_http2.so
#LoadModule proxy_http2_module modules/mod_proxy_http2.so
#LoadModule md_module modules/mod_md.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
Expand Down
11 changes: 6 additions & 5 deletions base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
## subcontract 1658085.
##

# The base image is just RHEL-8 OS with configuration for all ANMS containers.
# The base image is just RHEL-9 OS with configuration for all ANMS containers.
#
FROM registry.access.redhat.com/ubi8/ubi:8.6 AS anms-base
FROM registry.access.redhat.com/ubi9/ubi:9.2 AS anms-base

# Optional APL network configuration from
# https://aplprod.servicenowservices.com/sp?id=kb_article&sys_id=c0de6fe91b83d85071b143bae54bcb34
Expand All @@ -43,7 +43,7 @@ RUN groupadd -r -g 9999 ${APP_USER} && \
# This image uses systemd init process to manage local services.
# Derived image targets choose which servies are enabled.
#
FROM registry.access.redhat.com/ubi8/ubi-init:8.6 AS anms-init
FROM registry.access.redhat.com/ubi9/ubi-init:9.2 AS anms-init

# Optional APL network configuration from
# https://aplprod.servicenowservices.com/sp?id=kb_article&sys_id=c0de6fe91b83d85071b143bae54bcb34
Expand All @@ -54,6 +54,7 @@ RUN ( \
) || true
ENV PIP_CERT=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
ENV PIP_DEFAULT_TIMEOUT=300
RUN dnf -y install container-tools
# Container service config
RUN systemctl disable dnf-makecache.timer

Expand All @@ -67,9 +68,9 @@ FROM anms-base AS anms-acelib

# Install System Level Dependencies
RUN --mount=type=cache,target=/root/.cache/pip \
dnf -y install python39 python39-pip python39-wheel python39-setuptools && \
dnf -y install python3 python3-pip python3-wheel python3-setuptools && \
dnf clean all && rm -rf /var/cache/yum && \
pip3 install --upgrade pip pip-tools && ln -s pip3 /usr/bin/pip
pip3 install --upgrade pip pip-tools

# Submodules with dependencies
env PY_WHEEL_DIR=/usr/local/lib/wheels
Expand Down
2 changes: 1 addition & 1 deletion cam-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile to create docker image for ASEC CAM Gateway

FROM redhat/ubi8
FROM redhat/ubi9

MAINTAINER "Kam Tso" <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion cam-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This Git repo consists a Dockerfile, httpd config files, CAM web agent, and setu

The Dockerfile is used to create the docker image of the 5.1.0 CAM Gateway.
The image contains:
- Redhat ubi8 (Universal Base Image 8)
- Redhat ubi9 (Universal Base Image 9)
- Apache httpd 2.4
- CAM web agent 5.9.1
- CAM Gateway setup scripts
Expand Down
2 changes: 1 addition & 1 deletion checkout-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM anms-base

COPY . /usr/src/checkout-test
RUN --mount=type=cache,target=/var/cache/yum \
dnf -y install python39 python39-pip python39-wheel
dnf -y install python3 python3-pip python3-wheel
RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install -r /usr/src/checkout-test/requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion create_volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi
docker volume create ${VOLNAME}
CTRNAME=$(docker run --detach --rm \
-v ${VOLNAME}:${VOLPATH} -it \
redhat/ubi8 tail -f /dev/null)
redhat/ubi9 tail -f /dev/null)

docker exec ${CTRNAME} rm -rf ${VOLPATH}/*
for FN in ${SRCPATH}/*
Expand Down
2 changes: 1 addition & 1 deletion ion/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN dnf -y install \
perl-CPAN \
gdb less && \
dnf clean all && rm -rf /var/cache/yum && \
PERL_MM_USE_DEFAULT=1 cpan --notest JSON REST::Client Expect File::Slurp
PERL_MM_USE_DEFAULT=1 cpan -T JSON REST::Client Expect File::Slurp

# Build from added source
COPY src *.patch /usr/src/ion-ios/
Expand Down
8 changes: 1 addition & 7 deletions transcoder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@
## the prime contract 80NM0018D0004 between the Caltech and NASA under
## subcontract 1658085.
##
FROM anms-base

FROM anms-acelib
ENV APP_WORK_DIR /opt/app

# Install System Level Dependencies
RUN dnf -y install python39 python39-pip && \
dnf clean all && rm -rf /var/cache/yum && \
pip3 install --upgrade pip


# Copy over all required content (source, data, etc.)
COPY --chown=${APP_USER}:${APP_USER} . ${APP_WORK_DIR}
Expand Down

0 comments on commit 25e02a1

Please sign in to comment.