Skip to content

Commit 1f3c05c

Browse files
committed
various documentation fixes
1 parent faafd3d commit 1f3c05c

File tree

15 files changed

+60
-124
lines changed

15 files changed

+60
-124
lines changed

.github/workflows/single.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,17 @@ if [[ "$SKIP_SFTP" != "true" ]]; then
164164
sshpass -p $GALAXY_USER_PASSWD sftp -v -P 8022 -o User=$GALAXY_USER -o "StrictHostKeyChecking no" localhost <<< $'put time.txt'
165165
fi
166166
167+
# Test FTP Server from within the container (avoids host NAT/passive issues)
168+
docker_exec python - <<'PY'
169+
import ftplib
170+
171+
ftp = ftplib.FTP()
172+
ftp.connect("localhost", 21, timeout=30)
173+
ftp.login("admin@example.org", "password")
174+
ftp.retrlines("LIST")
175+
ftp.quit()
176+
PY
177+
167178
# Test CVMFS
168179
docker_exec bash -c "service autofs start"
169180
docker_exec bash -c "cvmfs_config chksetup"

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ One of the main goals is to make access to entire tool suites as easy as possibl
1414
this includes the setup of a public available web-service that needs to be maintained, or that the Tool-user needs to either setup a Galaxy Server by its own or to have Admin access to a local Galaxy server.
1515
With docker, tool developers can create their own Image with all dependencies and the user only needs to run it within docker.
1616

17-
The Image is based on [Ubuntu 22.04 LTS](http://releases.ubuntu.com/22.04/) and all recommended Galaxy requirements are installed. The following chart should illustrate the [Docker](http://www.docker.io) image hierarchy we have build to make is as easy as possible to build on different layers of our stack and create many exciting Galaxy flavors.
17+
The Image is based on [Ubuntu 24.04 LTS](http://releases.ubuntu.com/24.04/) and all recommended Galaxy requirements are installed. The following chart should illustrate the [Docker](http://www.docker.io) image hierarchy we have build to make is as easy as possible to build on different layers of our stack and create many exciting Galaxy flavors.
1818

1919
![Docker hierarchy](https://raw.githubusercontent.com/bgruening/docker-galaxy-stable/master/chart.png)
2020

@@ -115,6 +115,10 @@ With the additional `-v /home/user/galaxy_storage/:/export/` parameter, Docker w
115115

116116
This enables you to have different export folders for different sessions - means real separation of your different projects.
117117

118+
To detect when the Galaxy distribution in the image changes, the container writes a marker at
119+
`/export/.galaxy_export_marker`. You can override the marker value with `GALAXY_EXPORT_MARKER` if you
120+
need deterministic export refresh behavior.
121+
118122
You can also collect and store `/export/` data of Galaxy instances in a dedicated docker [Data volume Container](https://docs.docker.com/engine/userguide/dockervolumes/) created by:
119123

120124
```sh
@@ -517,7 +521,16 @@ This is achieved by connecting to Galaxy's CernVM filesystem (CVMFS) at `cvmfs-c
517521
The CVMFS capability doesn't add to the size of the Docker image, but when running, CVMFS maintains
518522
a cache to keep the most recently used data on the local disk.
519523
520-
*Note*: for CVMFS directories to be mounted-on-demand with `autofs`, you must launch Docker as `--privileged`
524+
*Note*: for CVMFS directories to be mounted-on-demand with `autofs`, you must launch Docker as `--privileged`.
525+
If privileged mode is not an option, use the optional CVMFS sidecar in `galaxy/docker-compose.yaml`:
526+
527+
```sh
528+
cd galaxy
529+
CVMFS_MOUNT_DIR=/cvmfs EXPORT_DIR=./export docker compose --profile cvmfs up
530+
```
531+
532+
This starts a dedicated CVMFS container that mounts the repositories and shares `/cvmfs` with the Galaxy
533+
container. The CVMFS cache is persisted in `${EXPORT_DIR}/cvmfs-cache`.
521534
522535
523536
## Personalize your Galaxy <a name="Personalize-your-Galaxy" /> [[toc]](#toc)
@@ -748,6 +761,7 @@ When you execute the tool again, Galaxy will pull the image from Biocontainers (
748761
| `LOAD_GALAXY_CONDITIONAL_DEPENDENCIES` | Installing optional dependencies into the Galaxy virtual environment |
749762
| `LOAD_PYTHON_DEV_DEPENDENCIES` | Installation of Galaxy's dev dependencies. Needs `LOAD_GALAXY_CONDITIONAL_DEPENDENCIES` as well |
750763
| `GALAXY_AUTO_UPDATE_DB` | Run the Galaxy database migration script during startup |
764+
| `GALAXY_EXPORT_MARKER` | Override the export marker used to refresh `/export/galaxy`. |
751765

752766

753767
# HTTPS Support <a name="HTTPS-Support"/> [[toc]](#toc)

cvmfs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
2525
RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh
2626

2727
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
28-
CMD ["tail", "-f", "/dev/null"]
28+
CMD ["bash", "-lc", "tail -F /var/log/autofs.log /var/log/cvmfs.log 2>/dev/null"]

cvmfs/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ repos="${repos//,/ }"
66

77
mkdir -p /cvmfs
88
mkdir -p "${CVMFS_CACHE_BASE:-/var/lib/cvmfs}"
9+
touch /var/log/autofs.log /var/log/cvmfs.log
910

1011
if [[ ! -f "${CVMFS_CACHE_BASE:-/var/lib/cvmfs}/.configured" ]]; then
1112
ansible-playbook /ansible/playbook.yml

galaxy/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ RUN apt-get -qq update \
174174
# Install ansible roles
175175
&& ansible-galaxy install -r /ansible/requirements.yml -p /ansible/roles \
176176
&& npm install -g @galaxyproject/gx-it-proxy@latest \
177+
&& apt-get purge -y npm \
178+
&& apt-get autoremove -y \
177179
&& groupadd -r $GALAXY_USER -g $GALAXY_GID \
178180
&& useradd -u $GALAXY_UID -r -g $GALAXY_USER -d $GALAXY_HOME -m -c "Galaxy user" --shell /bin/bash $GALAXY_USER \
179181
# Create the postgres user before apt-get does (with the configured UID/GID) to facilitate sharing $EXPORT_DIR/postgresql with non-Linux hosts
@@ -292,6 +294,7 @@ RUN mkdir -p $GALAXY_CONFIG_TUS_UPLOAD_STORE \
292294
&& curl -o $GALAXY_CONFIG_TOOL_DATA_TABLE_CONFIG_PATH \
293295
-L https://raw.githubusercontent.com/galaxyproject/usegalaxy-playbook/8adb1f82c94fe95b09df2a2816440ce2420b7d39/env/main/files/galaxy/config/tool_data_table_conf.xml \
294296
&& chown $GALAXY_USER:$GALAXY_USER $GALAXY_CONFIG_TOOL_DATA_TABLE_CONFIG_PATH \
297+
# Ensure Galaxy uses the jemalloc we built (gridengine compatibility: #10425).
295298
&& mv /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2.orig \
296299
&& ln -s /usr/local/lib/libjemalloc.so.2 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
297300

galaxy/ansible/nginx.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
connection: local
33
remote_user: root
44
vars:
5+
# Default container config: avoid DH param generation and OCSP stapling
6+
# errors in ephemeral/self-signed setups. Override in production.
57
nginx_conf_ssl_protocols:
68
- TLSv1.2
79
- TLSv1.3

galaxy/ansible/rabbitmq.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
vars:
55
rabbitmq_keyring_path: /usr/share/keyrings/com.rabbitmq.team.gpg
66
rabbitmq_repo_list_path: /etc/apt/sources.list.d/rabbitmq.list
7+
rabbitmq_version: 4.2.2-1
78
rabbitmq_erlang_packages:
89
- erlang-base
910
- erlang-asn1
@@ -58,7 +59,7 @@
5859

5960
- name: Install RabbitMQ server
6061
apt:
61-
name: rabbitmq-server
62+
name: "rabbitmq-server={{ rabbitmq_version }}"
6263
state: present
6364
update_cache: true
6465

galaxy/ansible/requirements.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ roles:
55
- name: geerlingguy.docker
66
version: 7.9.0
77
- name: usegalaxy_eu.flower
8-
src: https://github.com/usegalaxy-eu/flower-ansible-role
98
version: 2.1.1
109
- name: grycap.htcondor
1110
src: https://github.com/usegalaxy-eu/ansible-htcondor-grycap
@@ -27,7 +26,6 @@ roles:
2726
- name: galaxyproject.nginx
2827
version: 1.0.0
2928
- name: usegalaxy_eu.certbot
30-
src: https://github.com/usegalaxy-eu/ansible-certbot
3129
version: 0.1.13
3230
- name: galaxyproject.self_signed_certs
3331
version: 0.0.4

galaxy/ansible/templates/export_user_files.py.j2

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PG_VERSION = os.environ.get('PG_VERSION', '15')
1212
GALAXY_UID = int(os.environ['GALAXY_UID'])
1313
GALAXY_GID = int(os.environ['GALAXY_GID'])
1414
GALAXY_ROOT_DIR = os.environ.get('GALAXY_ROOT_DIR', '/galaxy/')
15-
GALAXY_IMAGE_MARKER_PATH = '/export/.galaxy_image_marker'
15+
GALAXY_EXPORT_MARKER_PATH = '/export/.galaxy_export_marker'
1616

1717
if len( sys.argv ) == 2:
1818
PG_DATA_DIR_DEFAULT = sys.argv[1]
@@ -73,14 +73,15 @@ def _ignore_static(dir, *patterns):
7373
return __ignore_static
7474

7575
def _read_image_marker():
76-
marker = os.environ.get('GALAXY_IMAGE_MARKER')
76+
marker = os.environ.get('GALAXY_EXPORT_MARKER')
7777
if marker:
7878
return marker.strip()
7979
version_py = os.path.join(GALAXY_ROOT_DIR, 'lib', 'galaxy', 'version.py')
8080
if os.path.exists(version_py):
8181
try:
8282
with open(version_py, 'r', encoding='utf-8', errors='ignore') as handle:
8383
text = handle.read()
84+
# Extract __version__ without importing Galaxy modules during startup.
8485
match = re.search(r'__version__\\s*=\\s*[\\\'"]([^\\\'"]+)[\\\'"]', text)
8586
if match:
8687
return f"version:{match.group(1)}"
@@ -104,26 +105,27 @@ def _should_copy_distribution(marker):
104105
if not marker:
105106
return True
106107
try:
107-
with open(GALAXY_IMAGE_MARKER_PATH, 'r', encoding='utf-8') as handle:
108+
# Explicit UTF-8 decoding avoids locale-dependent behavior for marker files.
109+
with open(GALAXY_EXPORT_MARKER_PATH, 'r', encoding='utf-8') as handle:
108110
return handle.read().strip() != marker
109111
except OSError:
110112
return True
111113

112114
def _write_marker(marker):
113115
if not marker:
114116
return
115-
tmp_path = f"{GALAXY_IMAGE_MARKER_PATH}.tmp"
117+
tmp_path = f"{GALAXY_EXPORT_MARKER_PATH}.tmp"
116118
with open(tmp_path, 'w', encoding='utf-8') as handle:
117119
handle.write(marker + '\n')
118-
os.replace(tmp_path, GALAXY_IMAGE_MARKER_PATH)
120+
os.replace(tmp_path, GALAXY_EXPORT_MARKER_PATH)
119121

120122
if __name__ == "__main__":
121123
"""
122124
If the '/export/' folder exist, meaning docker was started with '-v /home/foo/bar:/export',
123-
we will link every file that needs to persist to the host system. Addionaly a file (/.galaxy_save) is
124-
created that indicates all linking is already done.
125-
If the user re-starts (with docker start) the container the file /.galaxy_save is found and the linking
126-
is aborted.
125+
we will link every file that needs to persist to the host system. A marker file at
126+
/export/.galaxy_export_marker is written to indicate the export contents match the image version.
127+
If the user re-starts (with docker start) the container and the marker matches, the linking
128+
is skipped.
127129
"""
128130
marker = _read_image_marker()
129131
if _should_copy_distribution(marker):

galaxy/ansible/templates/supervisor.conf.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ stdout_logfile = /var/log/autofs.log
3232
[program:munge]
3333
user=root
3434
# In VMs the chown seems to be needed, in containers the mkdir.
35-
command=/bin/bash -c "mkdir -p /var/run/munge && chown -R root:root /var/run/munge && /usr/sbin/munged -f -F --num-threads=10"
35+
# Keep munge threads modest by default; increase via munge_num_threads if needed.
36+
command=/bin/bash -c "mkdir -p /var/run/munge && chown -R root:root /var/run/munge && /usr/sbin/munged -f -F --num-threads={{ munge_num_threads | default(2) }}"
3637
redirect_stderr = true
3738
priority = 100
3839
stopasgroup = true

0 commit comments

Comments
 (0)