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

make aurora use conda ansible #622

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ebe860d
make aurora use conda ansible
Sep 19, 2024
61a9be4
Update run-ansible.sh
carebare47 Sep 19, 2024
09fd9b4
Update run-ansible.sh
carebare47 Sep 19, 2024
0e7c2b6
Update conda_utils.sh
carebare47 Sep 20, 2024
0194890
Update run-ansible.sh
carebare47 Sep 20, 2024
c3eb56f
Update run-ansible.sh
carebare47 Sep 20, 2024
0a82dc0
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 20, 2024
7f4034b
is ansible_control node local to server ec2 test?
Sep 20, 2024
0357969
set execution bit for Desktop folder (make ec2 checks work)
Sep 20, 2024
43f8e49
add dbus-launch to gio set
Sep 20, 2024
cd50fab
debugging gio info
Sep 20, 2024
6133ab3
gio info on .desktop file instead (debug)
Sep 20, 2024
1e2b5c6
forgive me
Sep 20, 2024
4663ecf
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
rnzenha-s Sep 23, 2024
738e6e1
try ubuntu desktop gui ami (for icon deployment)
Sep 23, 2024
4858c9f
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 23, 2024
e924912
move to ami with unattended upgrade disabled
Sep 23, 2024
2641cfc
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 23, 2024
2a40854
attempted idempotency fix
Sep 23, 2024
5fc125e
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 23, 2024
cbed28a
changed_when: false on icon template (why is this not idempotent?)
Sep 23, 2024
5ed2f23
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 23, 2024
46cd8d7
indent on demo-icons, remove skip task from dolphin-icons
Sep 23, 2024
8e7081e
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 23, 2024
04ae0d7
oops
Sep 23, 2024
1af7163
indent
Sep 23, 2024
9dee7bb
more errors
Sep 23, 2024
8cc29c8
oops
Sep 23, 2024
1663e7f
make gio idempotent
Sep 23, 2024
0fa0e9a
cleaner
Sep 23, 2024
bafb73a
escape spaces
Sep 23, 2024
27b8c60
testing
Sep 24, 2024
b56a94a
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 24, 2024
ca0061e
try escaping spaces again
Sep 24, 2024
fdbf3f8
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 24, 2024
bb3ad83
still can't escape
Sep 24, 2024
7e8b086
grep returns 1 on no match
Sep 25, 2024
59cbc3e
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 25, 2024
2a01a21
idempotency
Sep 25, 2024
eed73a0
idempotence
Sep 25, 2024
0ac65aa
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 25, 2024
e444988
idempotence
Sep 25, 2024
3d345bd
Merge branch 'master' of github.com:shadow-robot/aurora
Sep 25, 2024
c55386a
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 25, 2024
7a6fa56
(hopefully) final idempotence, disable icon python tests
Sep 26, 2024
e6d1413
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 26, 2024
f69570e
trigger checks
Sep 26, 2024
d12bed7
Merge branch 'master' into F#SWC-50_make_aurora_use_conda_ansible
carebare47 Sep 26, 2024
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
10 changes: 6 additions & 4 deletions bin/conda_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ miniconda_installer="${miniconda_install_root}/miniconda_installer.sh"
miniconda_installer_url="https://repo.anaconda.com/miniconda/Miniconda3-py311_23.5.2-0-Linux-x86_64.sh"
miniconda_checksum="634d76df5e489c44ade4085552b97bebc786d49245ed1a830022b0b406de5817"
packages_download_root="${miniconda_install_root}/aurora_host_packages"
shadow_conda_ws_dir="${miniconda_install_location}/envs/${conda_ws_name}"
aurora_python_version="3.8"

# Some molecule tests install to `/home/...` (no user account)
if [ -z $USER ]; then
Expand Down Expand Up @@ -68,7 +70,7 @@ _fetch_new_files() {
echo "Fetching ${aws_bucket_dir}..."
mkdir -p $local_download_dir

remote_packages=$(curl -Ls ${aws_bucket_url} | xq | grep $aws_bucket_dir | grep 'Key' | sed -r "s/.*${aws_bucket_dir}\///g" | sed -r 's/",//g' | sed -r 's;</Key>;;g')
remote_packages=$(curl -Ls ${aws_bucket_url} | python -m xq | grep $aws_bucket_dir | grep 'Key' | sed -r "s/.*${aws_bucket_dir}\///g" | sed -r 's/",//g' | sed -r 's;</Key>;;g')

echo "remote_packages: ${remote_packages}"

Expand Down Expand Up @@ -116,14 +118,14 @@ create_conda_ws(){
if [ -d "$shadow_conda_ws_dir" ]; then
rm -rf $shadow_conda_ws_dir
fi
${miniconda_install_location}/bin/conda create -y -n ${conda_ws_name} python=3.8 && source ${miniconda_install_location}/bin/activate ${conda_ws_name}
python -m pip install yq xq
${miniconda_install_location}/bin/conda create -y -n ${conda_ws_name} python=${aurora_python_version} && source ${miniconda_install_location}/bin/activate ${conda_ws_name}
${shadow_conda_ws_dir}/bin/pip install yq xq
}

fetch_pip_files(){ _fetch_new_files "http://shadowrobot.aurora-host-packages-${codename}.s3.eu-west-2.amazonaws.com" "pip_packages"; }
fetch_ansible_files() { _fetch_new_files "http://shadowrobot.aurora-host-packages-${codename}.s3.eu-west-2.amazonaws.com" "ansible_collections"; }

install_pip_packages() { ANSIBLE_SKIP_CONFLICT_CHECK=1 python -m pip install ${packages_download_root}/pip_packages/* ; }
install_pip_packages() { ANSIBLE_SKIP_CONFLICT_CHECK=1 ${shadow_conda_ws_dir}/bin/pip install ${packages_download_root}/pip_packages/* ; }
install_ansible_collections() {
ansible_galaxy_executable=$1
"${ansible_galaxy_executable}" collection install $(realpath ${packages_download_root}/ansible_collections/*)
Expand Down
28 changes: 18 additions & 10 deletions bin/run-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,24 +421,32 @@ else
echo ""
fi

ansible_executable=~/.local/bin/ansible-playbook
if [[ ! -f "${ansible_executable}" ]]; then
# Awful hack to make bionic checks pass (they need to be disabled)
if [[ $codename == *"bionic"* ]]; then
ansible_executable=~/.local/bin/ansible-playbook
if [[ ! -f "${ansible_executable}" ]]; then
ansible_executable=ansible-playbook
fi
ansible_basic_executable=~/.local/bin/ansible
if [[ ! -f "${ansible_basic_executable}" ]]; then
ansible_basic_executable=ansible
fi
ansible_galaxy_executable=~/.local/bin/ansible-galaxy
if [[ ! -f "${ansible_galaxy_executable}" ]]; then
ansible_galaxy_executable=ansible-galaxy
fi
else
ansible_executable=ansible-playbook
fi
ansible_basic_executable=~/.local/bin/ansible
if [[ ! -f "${ansible_basic_executable}" ]]; then
ansible_basic_executable=ansible
fi
ansible_galaxy_executable=~/.local/bin/ansible-galaxy
if [[ ! -f "${ansible_galaxy_executable}" ]]; then
ansible_galaxy_executable=ansible-galaxy
# Use conda packages/modules first
export PYTHONPATH="${shadow_conda_ws_dir}/lib/python${aurora_python_version}/site-packages"
toliver marked this conversation as resolved.
Show resolved Hide resolved
fi

# install ansible galaxy docker and aws collections
"${ansible_basic_executable}" --version
install_ansible_collections "${ansible_galaxy_executable}"


#configure DHCP before running the actual playbook
if [[ "${playbook}" = "server_and_nuc_deploy" ]]; then
# router = false is default group_var, only install dhcp server on laptop if product is not arm+hand and user has not overridden router=true
Expand All @@ -460,4 +468,4 @@ echo ""
echo " ------------------------------------------------"
echo " | Operation completed |"
echo " ------------------------------------------------"
echo ""
echo ""