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

Enable path-based interactive tools #1256

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions group_vars/sn06.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ gie_proxy_nodejs_version: "10.13.0"
gie_proxy_virtualenv: "{{ galaxy_root }}/gie-proxy/venv"
gie_proxy_setup_service: systemd
gie_proxy_sessions_path: "{{ galaxy_mutable_data_dir }}/interactivetools_map.sqlite"
gie_proxy_path_prefix: /interactivetool/ep
gie_proxy_port: 8800
gie_proxy_verbose: true

Expand Down
1 change: 1 addition & 0 deletions group_vars/sn07.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ gie_proxy_nodejs_version: "10.13.0"
gie_proxy_virtualenv: "{{ galaxy_root }}/gie-proxy/venv"
gie_proxy_setup_service: systemd
gie_proxy_sessions_path: "{{ galaxy_mutable_data_dir }}/interactivetools_map.sqlite"
gie_proxy_path_prefix: /interactivetool/ep
gie_proxy_port: 8800
gie_proxy_verbose: true

Expand Down
2 changes: 1 addition & 1 deletion requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ roles:
src: https://github.com/usegalaxy-eu/ansible-update-hosts
version: 0.2.0
- name: usegalaxy_eu.gie_proxy
version: 0.0.2
version: 0.1.0
- name: usegalaxy-eu.autofs
src: https://github.com/usegalaxy-eu/ansible-autofs
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion templates/nginx/galaxy-ie-main.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ server {
access_log /var/log/nginx/interactive.log;

location / {
proxy_pass http://127.0.0.1:8800;
proxy_pass http://127.0.0.1:{{ gie_proxy_port }};
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
Expand Down
10 changes: 10 additions & 0 deletions templates/nginx/galaxy-main.j2
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ server {
proxy_set_header Connection "upgrade";
}

# Route all path-based interactive tool requests to the InteractiveTool proxy application
location ~* ^/(interactivetool/.+)$ {
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:{{ gie_proxy_port }};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question: I see on the main nginx conf that the path /gie_proxy is suffixed after the port here. Is that necessary for this proxy_pass as well?

Copy link
Contributor Author

@kysrpex kysrpex Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I do not know what the path

	# Global GIE configuration
	location /gie_proxy {
		proxy_pass http://127.0.0.1:8800/gie_proxy;
		proxy_redirect off;
	}

does (maybe @hexylena has a clue? <- git blame). As far as I know, the configuration that is making domain-based interactive tools work is this one.

	server_name ~^(?<key>[0-9a-z-]*)\.ep\.interactivetool\.(?<domain>[a-z0-9.-]*)usegalaxy\.eu$;

	[...]

	location / {
		proxy_pass http://127.0.0.1:8800;
		proxy_redirect off;
		proxy_http_version 1.1;
		proxy_set_header Host $host;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;
	}

See also the Galaxy docs. Both in the excerpt above and the Galaxy docs you can see that it is not necessary to add the prefix again, regardless of whether the tool is domain-based or path-based. I assume it's needed only if you want special behavior (e.g. alter the prefix).

Edit: testing galaxyproject/galaxy#18481 involved configuring nginx for both types of interactive tools, and they work fine, no extra prefix needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Adding an extra prefix would OTOH mess up path-based ITs.

Also the solution for supporting path-based ITs might differ from tool to tool. The config @sanjaysrikakulam refers to above will work if all paths in the web server in the IT are relative. If not, other solutions for injecting the path are available, as
documented in the Galaxy admin docs.

}

location /.well-known/ {
proxy_set_header Host $host:$server_port;
Expand Down
Loading