-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add artcommon to install #161
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ LABEL name="art-bot" \ | |
description="art-bot container image" \ | ||
maintainer="OpenShift Automated Release Tooling (ART) Team <[email protected]>" | ||
|
||
# the build will need to run inside the firewall to access internal resources. | ||
# install Red Hat IT Root CA and RCM repos | ||
# This build will need to be run inside the firewall to access internal resources. | ||
# Install Red Hat IT Root CA and RCM repos, runtime dependencies, and upgrade pip | ||
RUN curl -o /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt --fail -L \ | ||
https://certs.corp.redhat.com/certs/2015-IT-Root-CA.pem \ | ||
&& curl -o /etc/pki/ca-trust/source/anchors/2022-IT-Root-CA.pem --fail -L \ | ||
|
@@ -16,15 +16,17 @@ RUN curl -o /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt --fail -L \ | |
krb5-workstation git rsync \ | ||
python3 python3-certifi python3-rpm python3-rhmsg \ | ||
# development dependencies | ||
gcc krb5-devel python3-devel python3-pip python3-setuptools \ | ||
gcc krb5-devel python3-devel python3-pip \ | ||
# other tools | ||
bash-completion vim tmux wget curl iputils procps-ng psmisc net-tools iproute \ | ||
# install brewkoji | ||
koji brewkoji \ | ||
&& dnf clean all | ||
&& dnf clean all \ | ||
# upgrade pip | ||
&& pip3 install --upgrade pip | ||
|
||
# Install OpenShift Client | ||
ARG OC_VERSION=candidate | ||
# include oc client | ||
RUN wget -O /tmp/openshift-client-linux-"$OC_VERSION".tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/"$OC_VERSION"/openshift-client-linux.tar.gz \ | ||
&& tar -C /usr/local/bin -xzf /tmp/openshift-client-linux-"$OC_VERSION".tar.gz oc kubectl \ | ||
&& rm /tmp/openshift-client-linux-"$OC_VERSION".tar.gz | ||
|
@@ -35,38 +37,35 @@ ARG USERNAME=dev | |
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create the "dev" user | ||
RUN groupadd --gid "$USER_GID" "$USERNAME" \ | ||
&& useradd --uid "$USER_UID" --gid "$USER_GID" -m "$USERNAME" \ | ||
# give access to its files | ||
&& mkdir -p /workspaces/art-bot \ | ||
&& mkdir -p /workspaces/{elliott,doozer}{,-working-dir} \ | ||
&& mkdir -p /home/"$USERNAME"/.config/{elliott,doozer,art-bot} \ | ||
&& mkdir -p /home/"$USERNAME"/.docker \ | ||
&& mkdir -p /workspaces/art-bot /workspaces/{elliott,doozer}{,-working-dir} \ | ||
/home/"$USERNAME"/.config/{elliott,doozer,art-bot} /home/"$USERNAME"/.docker \ | ||
&& chown -R "${USER_UID}:${USER_GID}" /home/"$USERNAME" /workspaces \ | ||
&& chmod -R 0755 /home/"$USERNAME" \ | ||
&& chmod -R 0777 /workspaces \ | ||
# and allow it passwordless sudo | ||
&& echo "$USERNAME" ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/"$USERNAME" \ | ||
&& echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/"$USERNAME" \ | ||
&& chmod 0440 /etc/sudoers.d/"$USERNAME" | ||
|
||
USER "$USER_UID" | ||
# Set work directory | ||
WORKDIR /workspaces/art-bot | ||
|
||
# install dependencies (allow even openshift's random user to see) | ||
ENV PATH=/home/"$USERNAME"/.local/bin:/home/"$USERNAME"/bin:"$PATH" | ||
# Clone art-tools and run install.sh script | ||
RUN git clone https://github.com/openshift-eng/art-tools.git art-tools \ | ||
&& cd art-tools \ | ||
&& ./install.sh | ||
|
||
# Install dependencies from requirements.txt | ||
COPY requirements.txt ./ | ||
RUN umask a+rx && pip3 install --upgrade \ | ||
"git+https://github.com/openshift-eng/art-tools.git#egg=rh-doozer&subdirectory=doozer" \ | ||
"git+https://github.com/openshift-eng/art-tools.git#egg=rh-elliott&subdirectory=elliott" \ | ||
-r ./requirements.txt | ||
RUN pip3 install --upgrade -r requirements.txt | ||
|
||
# install art-bot and default configs | ||
# Install art-bot and default configs | ||
COPY container/krb5-redhat.conf /etc/krb5.conf | ||
COPY . /tmp/art-bot | ||
USER 0 | ||
RUN cp -r /tmp/art-bot/{artbotlib,art-bot.py,art_bot_dev.py} . \ | ||
&& cp /tmp/art-bot/container/doozer-settings.yaml /home/"$USERNAME"/.config/doozer/settings.yaml \ | ||
&& cp /tmp/art-bot/container/elliott-settings.yaml /home/"$USERNAME"/.config/elliott/settings.yaml \ | ||
&& rm -rf /tmp/art-bot | ||
USER "$USER_UID" | ||
|
||
# Set non-root user | ||
USER "$USER_UID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This can be removed if we use USER 0, need to check