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

Fix Creation of AWS Sandboxes + Containerize #103

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
34 changes: 31 additions & 3 deletions Containerfile.admin
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,70 @@ COPY ./ ./
RUN make

FROM registry.access.redhat.com/ubi8/ubi:latest AS deploy
USER root
RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm \
&& dnf install -y \
bash \
bzip2 \
bind-utils \
curl \
findutils \
gcc \
git \
glibc-langpack-en \
jq \
nc \
net-tools \
nodejs \
npm \
openssl \
postgresql \
python39 \
python39-pip \
python3.12 \
python3.12-pip \
rsync \
tar \
unzip \
vim \
wget \
&& dnf clean all \
&& sed -i 's/^LANG=.*/LANG="en_US.utf8"/' /etc/locale.conf \
&& VERSION=4.1.0 \
&& curl --silent --location https://github.com/Orange-OpenSource/hurl/releases/download/$VERSION/hurl-$VERSION-x86_64-unknown-linux-gnu.tar.gz \
| tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/hurl' '*/hurlfmt'
| tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/hurl' '*/hurlfmt' \
&& cd /tmp \
&& curl -s -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip "awscliv2.zip" \
&& ./aws/install && rm -rf awscliv2.zip aws

# Python

RUN alternatives --set python /usr/bin/python3.12 \
&& alternatives --set python3 /usr/bin/python3.12 \
&& alternatives --install /usr/bin/pip pip /usr/bin/pip3.12 1
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

COPY --from=docker.io/migrate/migrate /usr/local/bin/migrate /usr/local/bin/migrate
WORKDIR /sandbox/
USER ${USER_UID}
COPY build/github_known_hosts /ssh/known_hosts
env SSH_KNOWN_HOSTS /ssh/known_hosts
COPY --from=builder /sandbox/build/sandbox-* ./
COPY --from=builder /sandbox/build/sandbox-* /usr/bin/
COPY --from=builder /sandbox/tools ./tools
COPY --from=builder /sandbox/tests ./tests
COPY --from=builder /sandbox/db ./db
COPY --from=builder /sandbox/cloud-automation ./cloud-automation
COPY --from=builder /sandbox/playbooks ./playbooks

RUN cd cloud-automation && npm ci
COPY conan/ansible.cfg /etc/ansible/ansible.cfg
RUN rm -rf /tmp/* /root/.cache /root/*

CMD ["/bin/bash"]

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

ENV DESCRIPTION="Image for Admins to interact with the Sandbox API"
LABEL name="rhpds/sandbox-admin" \
Expand Down
4 changes: 2 additions & 2 deletions playbooks/create_range.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env ansible-playbook

- hosts: localhost
gather_facts: no
gather_facts: false
connection: local
run_once: yes
run_once: true
tasks:
- assert:
msg: Please set account_num_start
Expand Down
Loading
Loading