-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:shadow-robot/aurora
- Loading branch information
Showing
32 changed files
with
729 additions
and
6 deletions.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM public.ecr.aws/shadowrobot/ubuntu:jammy | ||
|
||
MAINTAINER "Shadow Robot's Software Team <[email protected]>" | ||
|
||
LABEL Description="Ubuntu Jammy image contains Ansible and Molecule" Vendor="Shadow Robot" Version="1.0" | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
ENV LANG C.UTF-8 | ||
|
||
ARG ml_base_aurora_branch | ||
|
||
ENV ml_base_aurora_branch ${ml_base_aurora_branch:-"master"} | ||
|
||
RUN set -x && \ | ||
apt-get update && \ | ||
\ | ||
echo "Installing wget" && \ | ||
apt-get install -y --no-install-recommends ca-certificates wget && \ | ||
\ | ||
echo "Installing dependencies for python3.8, SSL, pip3" && \ | ||
apt-get install -y build-essential zlib1g-dev libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev && \ | ||
\ | ||
echo "Installing git, sudo and Python 3 pip and dev" && \ | ||
apt-get install -y \ | ||
python3-dev \ | ||
python3-pip \ | ||
git \ | ||
libyaml-dev \ | ||
python3-cryptography \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
sshpass \ | ||
sudo && \ | ||
pip3 install --upgrade pip gcovr && \ | ||
echo "Cloning Aurora" && \ | ||
git clone --depth 1 https://github.com/shadow-robot/aurora.git -b $ml_base_aurora_branch /tmp/aurora && \ | ||
\ | ||
pip3 --version && \ | ||
python3 --version && \ | ||
echo "Installing molecule" && \ | ||
echo "cython<3" > /tmp/constraint.txt && \ | ||
PIP_CONSTRAINT=/tmp/constraint.txt pip3 install -r /tmp/aurora/ansible/data/molecule/requirements.txt && \ | ||
\ | ||
echo "Clean up" && \ | ||
apt-get clean && \ | ||
rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/root/.ansible \ | ||
/root/.gitconfig \ | ||
/root/.cache | ||
|
||
VOLUME /var/lib/docker | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Please read [these instructions](../../../../docs/molecule_dockers.md). |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright 2024 Shadow Robot Company Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the Free | ||
# Software Foundation version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
version: 0.2 | ||
env: | ||
shell: bash | ||
variables: | ||
branch: master | ||
image: aurora-molecule | ||
tag: jammy | ||
dockerfile_folder: docker/molecule/base/jammy/ | ||
exported-variables: | ||
- branch | ||
- image | ||
- tag | ||
- dockerfile_folder | ||
phases: | ||
build: | ||
commands: | ||
- cd .. | ||
- rm -rf aurora | ||
- git clone https://github.com/shadow-robot/aurora.git | ||
- cd aurora | ||
- git checkout $branch | ||
- cd $dockerfile_folder | ||
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot | ||
- docker build -t $image . | ||
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag | ||
- docker push public.ecr.aws/shadowrobot/$image:$tag | ||
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt | ||
- ids_to_delete=$(sed 's/^/imageDigest=/' ids_to_delete.txt) | ||
- if [[ -s ids_to_delete.txt ]]; then aws ecr-public batch-delete-image --repository-name $image --region us-east-1 --image-ids $ids_to_delete --output text; fi |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2024 Shadow Robot Company Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the Free | ||
# Software Foundation version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
version: '3' | ||
|
||
services: | ||
sut: | ||
build: | ||
context: . | ||
args: | ||
ml_base_aurora_branch: ${SOURCE_BRANCH} | ||
command: > | ||
bash -c "pip3 freeze | grep molecule && | ||
pip3 freeze | grep ansible && | ||
pip3 freeze | grep docker" | ||
environment: | ||
- SOURCE_BRANCH |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
export DOCKERFILE_PATH=${DOCKERFILE_PATH:-Dockerfile} | ||
|
||
echo "Executing build command" | ||
echo "docker build --build-arg ml_base_aurora_branch=${SOURCE_BRANCH} -f ${DOCKERFILE_PATH} -t ${IMAGE_NAME} ." | ||
|
||
docker build --build-arg ml_base_aurora_branch="${SOURCE_BRANCH}" -f "${DOCKERFILE_PATH}" -t "${IMAGE_NAME}" . |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM public.ecr.aws/shadowrobot/aurora-molecule-docker:jammy | ||
|
||
LABEL Description="Ubuntu Jammy image contains Ansible, Molecule, Docker and EC2 driver and Development tools with GUI" Vendor="Shadow Robot" Version="1.0" | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ENV PULSE_SERVER /run/pulse/native | ||
|
||
ARG ml_devel_aurora_branch | ||
|
||
ENV ml_devel_aurora_branch ${ml_devel_aurora_branch:-"master"} | ||
|
||
ENV ml_devel_aurora_script "https://raw.githubusercontent.com/shadow-robot/aurora/$ml_devel_aurora_branch/bin/run-ansible.sh" | ||
|
||
RUN set -x && \ | ||
\ | ||
echo "Downloading one-liner" && \ | ||
wget -O /tmp/oneliner "$( echo "$ml_devel_aurora_script" | sed 's/#/%23/g' )" && \ | ||
chmod 755 /tmp/oneliner && \ | ||
\ | ||
echo "Setting up UI and new Docker user" && \ | ||
/tmp/oneliner configure_software --branch $ml_devel_aurora_branch software=[setup-docker] && \ | ||
\ | ||
echo "Add user to docker group" && \ | ||
usermod -aG docker user && \ | ||
\ | ||
echo "Installing IDEs and AWS CLI" && \ | ||
/tmp/oneliner install_software --branch $ml_devel_aurora_branch software=[pycharm,vscode,aws-cli] && \ | ||
\ | ||
echo "Clean up" && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.ansible /root/.gitconfig /root/.cache | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
VOLUME /var/lib/docker | ||
CMD ["/usr/bin/terminator"] | ||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Launching container with UI | ||
|
||
In order to launch development image please use the following command | ||
|
||
```bash | ||
docker run -it --name sample_dev -e DISPLAY -e QT_X11_NO_MITSHM=1 -e LOCAL_USER_ID=$(id -u) \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw public.ecr.aws/shadowrobot/aurora-molecule-devel:jammy | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2024 Shadow Robot Company Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the Free | ||
# Software Foundation version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
version: 0.2 | ||
|
||
env: | ||
shell: bash | ||
variables: | ||
branch: master | ||
image: aurora-molecule-devel | ||
tag: jammy | ||
dockerfile_folder: docker/molecule/devel/jammy/ | ||
exported-variables: | ||
- branch | ||
- image | ||
- tag | ||
- dockerfile_folder | ||
phases: | ||
build: | ||
commands: | ||
- cd .. | ||
- rm -rf aurora | ||
- git clone https://github.com/shadow-robot/aurora.git | ||
- cd aurora | ||
- git checkout $branch | ||
- cd $dockerfile_folder | ||
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/shadowrobot | ||
- docker build -t $image . | ||
- docker tag $image:latest public.ecr.aws/shadowrobot/$image:$tag | ||
- docker push public.ecr.aws/shadowrobot/$image:$tag | ||
- comm -13 <(aws ecr-public describe-image-tags --repository-name $image --region us-east-1 --output text | awk '{print $3}' | tr " " "\n" | sort -u) <(aws ecr-public describe-images --repository-name $image --region us-east-1 --output text | awk '{print $2}' | tr " " "\n" | sort -u) >> ids_to_delete.txt | ||
- ids_to_delete=$(sed 's/^/imageDigest=/' ids_to_delete.txt) | ||
- if [[ -s ids_to_delete.txt ]]; then aws ecr-public batch-delete-image --repository-name $image --region us-east-1 --image-ids $ids_to_delete --output text; fi |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2024 Shadow Robot Company Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the Free | ||
# Software Foundation version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
version: '3' | ||
|
||
services: | ||
sut: | ||
build: | ||
context: . | ||
args: | ||
ml_devel_aurora_branch: ${SOURCE_BRANCH} | ||
command: > | ||
bash -c "aws --version && | ||
test -f /usr/bin/pycharm && | ||
test -f /usr/bin/code" | ||
environment: | ||
- SOURCE_BRANCH |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
export DOCKERFILE_PATH=${DOCKERFILE_PATH:-Dockerfile} | ||
|
||
echo "Executing build command" | ||
echo "docker build --build-arg ml_devel_aurora_branch=${SOURCE_BRANCH} -f ${DOCKERFILE_PATH} -t ${IMAGE_NAME} ." | ||
|
||
docker build --build-arg ml_devel_aurora_branch="${SOURCE_BRANCH}" -f "${DOCKERFILE_PATH}" -t "${IMAGE_NAME}" . |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM public.ecr.aws/shadowrobot/aurora-molecule:jammy | ||
|
||
LABEL Description="Ubuntu Jammy image contains Ansible, Molecule and Docker driver" Vendor="Shadow Robot" Version="1.0" | ||
|
||
ARG ml_docker_aurora_branch | ||
|
||
ENV ml_docker_aurora_branch ${ml_docker_aurora_branch:-"master"} | ||
|
||
ENV ml_docker_aurora_script "https://raw.githubusercontent.com/shadow-robot/aurora/$ml_docker_aurora_branch/bin/run-ansible.sh" | ||
|
||
RUN set -x && \ | ||
\ | ||
echo "Installing Docker" && \ | ||
wget -O /tmp/oneliner "$( echo "$ml_docker_aurora_script" | sed 's/#/%23/g' )" && \ | ||
chmod 755 /tmp/oneliner && \ | ||
/tmp/oneliner install_software --branch $ml_docker_aurora_branch software=[docker] skip_molecule_task=true && \ | ||
\ | ||
echo "Clean up" && \ | ||
apt-get clean && \ | ||
rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/root/.ansible \ | ||
/root/.gitconfig \ | ||
/root/.cache | ||
|
||
VOLUME /var/lib/docker |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Please read [these instructions](../../../../docs/molecule_dockers.md). |
Oops, something went wrong.