Skip to content

Commit d322b4a

Browse files
committed
Working PR
1 parent ba05c14 commit d322b4a

File tree

10 files changed

+74
-39
lines changed

10 files changed

+74
-39
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Galaxy will be available at `http://INSTANCE_IP/` once deployment completes
4949

5050
- `-k, --ssh-key`: SSH public key for the ubuntu user (required)
5151
- `-d, --disk-name`: Name of persistent disk (default: galaxy-data-INSTANCE_NAME)
52-
- `-i, --machine-image`: Machine image name (default: galaxy-k8s-boot-v2025-09-26)
52+
- `-i, --machine-image`: Machine image name (default: galaxy-k8s-boot-v2025-11-04)
5353
- `-m, --machine-type`: Machine type (default: e2-standard-4)
5454
- `-p, --project`: GCP project ID (default: anvil-and-terra-development)
5555
- `-s, --disk-size`: Size of persistent disk (default: 150GB)
@@ -77,11 +77,11 @@ gcloud compute instances create ea-rke2-c \
7777
--project=anvil-and-terra-development \
7878
--zone=us-east4-c \
7979
--machine-type=e2-standard-4 \
80-
--image=galaxy-k8s-boot-v2025-09-26 \
80+
--image=galaxy-k8s-boot-v2025-11-04 \
8181
--image-project=anvil-and-terra-development \
8282
--boot-disk-size=100GB \
8383
--boot-disk-type=pd-balanced \
84-
--create-disk=name=galaxy-data-disk,size=150GB,type=pd-balanced,device-name=galaxy-data,auto-delete=no \
84+
--create-disk=name=galaxy-data-disk,size=150GB,type=pd-balanced,device-name=galaxy-data,auto-delete=yes \
8585
--tags=k8s,http-server,https-server \
8686
--scopes=cloud-platform \
8787
--metadata=ssh-keys="ubuntu:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC66Snr9/0wpnzOkseCDm5xwq8zOI3EyEh0eec0MkED32ZBCFBcS1bnuwh8ZJtjgK0lDEfMAyR9ZwBlGM+BZW1j9h62gw6OyddTNjcKpFEdC9iA6VLpaVMjiEv9HgRw3CglxefYnEefG6j7RW4J9SU1RxEHwhUUPrhNv4whQe16kKaG6P6PNKH8tj8UCoHm3WdcJRXfRQEHkjoNpSAoYCcH3/534GnZrT892oyW2cfiz/0vXOeNkxp5uGZ0iss9XClxlM+eUYA/Klv/HV8YxP7lw8xWSGbTWqL7YkWa8qoQQPiV92qmJPriIC4dj+TuDsoMjbblcgMZN1En+1NEVMbV ea_key_pair"

bin/launch_vm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e
99
PROJECT="anvil-and-terra-development"
1010
ZONE="us-east4-c"
1111
MACHINE_TYPE="e2-standard-4"
12-
MACHINE_IMAGE="galaxy-k8s-boot-v2025-09-26"
12+
MACHINE_IMAGE="galaxy-k8s-boot-v2025-11-04"
1313
BOOT_DISK_SIZE="100GB"
1414
DISK_SIZE="150GB"
1515
DISK_TYPE="pd-balanced"
@@ -45,7 +45,7 @@ Examples:
4545
$0 -k "ssh-rsa AAAAB3..." my-galaxy-vm
4646
4747
# Launch VM with specific machine image
48-
$0 -k "ssh-rsa AAAAB3..." -i galaxy-k8s-boot-v2025-09-26 my-galaxy-vm
48+
$0 -k "ssh-rsa AAAAB3..." -i galaxy-k8s-boot-v2025-11-04 my-galaxy-vm
4949
5050
# Launch VM with specific disk name
5151
$0 -k "ssh-rsa AAAAB3..." -d galaxy-shared-disk my-galaxy-vm

bin/user_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ runcmd:
5959
echo "[`date`] - Inventory file created at /tmp/ansible-inventory/localhost; running ansible-pull..."
6060
echo "[`date`] - Galaxy persistence size: ${GXY_PERSISTENCE_SIZE}"
6161
62-
ANSIBLE_CALLBACKS_ENABLED=profile_tasks ANSIBLE_HOST_PATTERN_MISMATCH=ignore ansible-pull -U https://github.com/galaxyproject/galaxy-k8s-boot.git -C master -d /home/ubuntu/ansible -i /tmp/ansible-inventory/localhost --accept-host-key --limit 127.0.0.1 playbook.yml
62+
ANSIBLE_CALLBACKS_ENABLED=profile_tasks ANSIBLE_HOST_PATTERN_MISMATCH=ignore ansible-pull -U https://github.com/galaxyproject/galaxy-k8s-boot.git -C refactoring -d /home/ubuntu/ansible -i /tmp/ansible-inventory/localhost --accept-host-key --limit 127.0.0.1 playbook.yml
6363
6464
echo "[`date`] - User data script completed."
6565
'

image_prep.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@
4444
ansible.builtin.import_tasks: roles/image_preparation/tasks/base_packages.yml
4545
when: install_base_packages | bool
4646

47+
- name: Copy requirements.yml to remote host
48+
ansible.builtin.copy:
49+
src: requirements.yml
50+
dest: /tmp/galaxy-k8s-boot-requirements.yml
51+
mode: '0644'
52+
when: install_rke2_prerequisites | bool
53+
54+
- name: Install Ansible collections from requirements.yml
55+
ansible.builtin.command: ansible-galaxy collection install -r /tmp/galaxy-k8s-boot-requirements.yml
56+
changed_when: true
57+
when: install_rke2_prerequisites | bool
58+
59+
- name: Install Ansible roles from requirements.yml
60+
ansible.builtin.command: ansible-galaxy role install -r /tmp/galaxy-k8s-boot-requirements.yml
61+
changed_when: true
62+
when: install_rke2_prerequisites | bool
63+
4764
roles:
4865
- role: galaxyproject.cvmfs
4966
when: install_cvmfs | bool
@@ -136,6 +153,17 @@
136153
msg: "{{ item.cmd }} -> {{ item.stdout | default(item.stderr) }}"
137154
loop: "{{ version_checks.results }}"
138155

156+
- name: Verify Ansible roles are installed
157+
ansible.builtin.command: ansible-galaxy role list
158+
register: ansible_roles_list
159+
changed_when: false
160+
when: install_rke2_prerequisites | bool
161+
162+
- name: Display installed Ansible roles
163+
ansible.builtin.debug:
164+
var: ansible_roles_list.stdout_lines
165+
when: install_rke2_prerequisites | bool
166+
139167
- name: Create image preparation completion marker
140168
ansible.builtin.copy:
141169
content: |
@@ -146,6 +174,7 @@
146174
- Helm: {{ helm_version }} with pre-configured repositories (stable, cloudve)
147175
- CVMFS client with repositories: {{ cvmfs_verify_repos | join(', ') if install_cvmfs else 'NONE' }}
148176
- Container images: {{ 'Pre-fetched for faster deployment' if prefetch_container_images else 'Not cached' }}
177+
- Ansible roles and collections: Installed from requirements.yml
149178
150179
Next steps:
151180
1. Create image snapshot from this instance

requirements.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
collections:
55
- name: community.general
6-
version: ">=11.3.0"
6+
version: ">=11.3.0,<12.0.0"
77
- name: ansible.posix
8-
version: ">=2.1.0"
8+
version: ">=2.1.0,<3.0.0"
99
- name: kubernetes.core
10-
version: ">=6.1.0"
10+
version: ">=6.1.0,<7.0.0"
1111

1212
roles:
1313
- name: galaxyproject.cvmfs
14-
version: ">=0.3.2"
15-
- name: lablabs.rke2
16-
version: ">=1.48.0"
14+
version: "0.3.2"

roles/galaxy_k8s_deployment/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ingress_version: "4.13.2" # https://github.com/kubernetes/ingress-nginx?tab=rea
5757

5858
# Galaxy Application Configuration
5959
galaxy_chart: cloudve/galaxy
60-
galaxy_chart_version: "6.5.0"
60+
galaxy_chart_version: "6.5.1-dev"
6161
galaxy_deps_version: "1.1.1"
6262
galaxy_values_file: "values/values.yml"
6363
galaxy_persistence_size: "20Gi"

roles/image_preparation/README.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ gcloud compute instances create ea-mi \
7878
--project=anvil-and-terra-development \
7979
--zone=us-east4-b \
8080
--machine-type=n1-standard-2 \
81-
--image=ubuntu-minimal-2404-noble-amd64-v20251002 \
81+
--image=ubuntu-minimal-2404-noble-amd64-v20251020 \
8282
--image-project=ubuntu-os-cloud \
8383
--boot-disk-size=100GB \
8484
--tags=http-server,https-server \
@@ -89,11 +89,31 @@ gcloud compute instances create ea-mi \
8989

9090
### 2. Prepare Image
9191

92+
#### Customization
93+
94+
Override variables in `defaults/main.yml`, your inventory, or on the command
95+
line with parameters such as:
96+
97+
```bash
98+
# Different RKE2 version
99+
-e "rke2_version=v1.34.1+rke2r1"
100+
101+
# Different Helm version
102+
-e "helm_version=v3.19.0"
103+
```
104+
105+
---
106+
107+
Once a clean VM is running, create or update your inventory file with the
108+
instance details:
109+
92110
```bash
93-
# Create/update the inventory file with your instance details
94111
cp inventories/image_prep.ini.example inventories/image_prep.ini
112+
```
95113

96-
# Run the prep playbook
114+
Then run the prep playbook to configure it:
115+
116+
```bash
97117
./bin/prepare_image.sh -i inventories/image_prep.ini
98118
```
99119

@@ -107,27 +127,15 @@ gcloud compute instances stop ea-mi --zone=us-east4-b
107127
Create the image, updating the name and source disk as needed:
108128

109129
```bash
110-
gcloud compute images create galaxy-k8s-boot-v2025-09-26 \
130+
gcloud compute images create galaxy-k8s-boot-v2025-11-04 \
111131
--source-disk=ea-mi \
112132
--source-disk-zone=us-east4-b \
113133
--family=galaxy-k8s-boot \
114134
--storage-location=us
115135
```
116136

117-
### 4. Deploy Galaxy Cluster
118-
119-
Once the image is created, you can deploy a Galaxy cluster using the prepared
120-
image. Use the `playbook.yml` to set up the cluster, which has its own
121-
documentation in the main README.
122-
123-
## Customization
124-
125-
Override variables in inventory or command line:
126-
127-
```bash
128-
# Different RKE2 version
129-
-e "rke2_version=v1.34.1+rke2r1"
137+
### 4. Deploy Galaxy
130138

131-
# Different Helm version
132-
-e "helm_version=v3.19.0"
133-
```
139+
Once the image is created, you can deploy Galaxy using the prepared image. Use
140+
the `playbook.yml` to set up the cluster, which has its own documentation in the
141+
main README in this repo.

roles/image_preparation/files/container_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ container_images:
66
- docker.io/rancher/hardened-kubernetes:v1.34.1-rke2r1-build20250910
77
- docker.io/rancher/rke2-runtime:v1.34.1-rke2r1
88
- ghcr.io/cloudnative-pg/postgresql:17.2
9-
- quay.io/galaxyproject/galaxy-min:25.0.2
9+
- quay.io/galaxyproject/galaxy-min:25.1-auto
1010
- registry.k8s.io/sig-storage/nfs-provisioner:v4.0.8
1111
- docker.io/bitnamilegacy/rabbitmq-cluster-operator:1.14.0-scratch-r5
1212
- docker.io/bitnamilegacy/rmq-messaging-topology-operator:1.7.1-scratch-r3

roles/image_preparation/tasks/base_packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
- name: Update package cache (Ubuntu)
2+
- name: Update package cache
33
ansible.builtin.apt:
44
update_cache: true
55
cache_valid_time: 3600
66
become: true
77

8-
- name: Install base system packages (Ubuntu)
8+
- name: Install base system packages
99
ansible.builtin.apt:
1010
name: "{{ base_packages }}"
1111
state: present
1212
install_recommends: false
1313
become: true
1414

15-
- name: Install Python packages via apt (Ubuntu 24.04+ compatible)
15+
- name: Install Python packages via apt
1616
ansible.builtin.apt:
1717
name:
1818
- python3-kubernetes

roles/image_preparation/tasks/container_prefetch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
become: true
2525
when: rke2_binary.stat.exists
2626

27-
- name: Pre-fetch container images using RKE2's containerd
27+
- name: Pre-fetch container images
2828
ansible.builtin.command: ctr --address /run/k3s/containerd/containerd.sock -n k8s.io images pull {{ item }}
2929
register: pull_result
3030
failed_when: false
@@ -74,7 +74,7 @@
7474
become: true
7575
when: rke2_binary.stat.exists
7676

77-
- name: Clean up CNI and runtime state (with force removal)
77+
- name: Clean up CNI and runtime state
7878
ansible.builtin.shell: |
7979
rm -rf /var/lib/cni || true
8080
rm -rf /run/k3s || true

0 commit comments

Comments
 (0)