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

sequenceserver 3.1.2 #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Available variables are listed below, along with default values (see `defaults/m

```yaml
# Version of the ruby gem to install (>= 2.0.0)
sequenceserver_version: 2.2.0
sequenceserver_version: 3.1.2
```
Variable to set the version of SequenceServer to install. This role can be used with SequenceServer version >= 2.0.0.

Expand Down Expand Up @@ -66,7 +66,7 @@ SequenceServer logs are stored in `/var/log/sequenceserver/sequenceserver.log`.

```yaml
# Version of BLAST to use in sequenceserver (called with "module load" in the slurm bash script)
sequenceserver_blast_version: 2.14.0
sequenceserver_blast_version: 2.15.0
# Absolute path to the blast binaries
sequenceserver_blast_binaries: "~/conda3/envs/blast-{{ sequenceserver_blast_version }}/bin"
# --cpus-per-task (SLURM option)
Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Ruby gem
#
# Version of the ruby gem to install (>= 2.0.0)
sequenceserver_version: 2.2.0
sequenceserver_version: 3.1.2

# List of blast databases
#
Expand All @@ -30,7 +30,7 @@ sequenceserver_blast_db:
# Used in the slurm bash scripts
#
# Version of BLAST to use in sequenceserver (called with "module load" in the slurm bash script)
sequenceserver_blast_version: 2.14.0
sequenceserver_blast_version: 2.15.0
# Absolute path to the blast binaries
sequenceserver_blast_binaries: "~/conda3/envs/blast-{{ sequenceserver_blast_version }}/bin"
# --cpus-per-task (SLURM option)
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/tests/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- blast=2.14.0
- blast=2.15.0
4 changes: 2 additions & 2 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
become: true
tasks:
- name: Test blast installation
shell: # noqa 301 305

Check warning on line 7 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

7:14 [comments] too few spaces before comment

Check warning on line 7 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

7:14 [comments] too few spaces before comment
cmd: "/usr/local/anaconda/envs/blast/bin/blastn -version"
register: blast_command
failed_when: blast_command.rc > 0
- name: Test my_db
shell: # noqa 301 305

Check warning on line 12 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

12:14 [comments] too few spaces before comment

Check warning on line 12 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

12:14 [comments] too few spaces before comment
cmd: "/usr/local/anaconda/envs/blast/bin/blastdbcmd -db /tmp/test-data/my_db -entry all"
register: blastdbcmd_command
failed_when: blastdbcmd_command.rc > 0
- name: Ubuntu 20 | Test SequenceServer installation
shell: # noqa 301

Check warning on line 17 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

17:14 [comments] too few spaces before comment

Check warning on line 17 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

17:14 [comments] too few spaces before comment
cmd: "export GEM_PATH=/usr/local/share/gems && /usr/local/share/gems/bin/sequenceserver --version"
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "20"
register: sequenceserver_command
Expand Down Expand Up @@ -46,8 +46,8 @@
get_url:
url: "http://localhost"
dest: "/tmp/nginx.html"
- name: Test SequenceServer home page with curl # same thing tried with the ansible get_url module without success

Check warning on line 49 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

49:53 [comments] too few spaces before comment

Check warning on line 49 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

49:53 [comments] too few spaces before comment
shell: # noqa 301

Check warning on line 50 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

50:14 [comments] too few spaces before comment

Check warning on line 50 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

50:14 [comments] too few spaces before comment
cmd: "curl -sL http://localhost:4567 -o /tmp/home.html"
register: sequenceserver_command
failed_when: sequenceserver_command.rc > 0
Expand All @@ -59,33 +59,33 @@
debug:
msg: "{{ sequenceserver_page.content | b64decode }}"
- name: Check title in home page content
shell: # noqa 301

Check warning on line 62 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

62:14 [comments] too few spaces before comment

Check warning on line 62 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

62:14 [comments] too few spaces before comment
cmd: curl -sL http://localhost:4567 | grep -q 'http://myfavoritewebsite.com'
cmd: curl -sL http://localhost:4567 | grep -q 'BLAST server for my_db'
register: grep_title
failed_when: grep_title.rc > 0
- name: Check support email in home page content
shell: # noqa 301

Check warning on line 67 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

67:14 [comments] too few spaces before comment

Check warning on line 67 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

67:14 [comments] too few spaces before comment
cmd: curl -sL http://localhost:4567 | grep -q 'mailto:amazingsupport@myfavoritewebsite.com'
register: grep_support
failed_when: grep_support.rc > 0
- name: Check custom html in home page content (top)
shell: # noqa 301

Check warning on line 72 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

72:14 [comments] too few spaces before comment

Check warning on line 72 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

72:14 [comments] too few spaces before comment
cmd: curl -sL http://localhost:4567 | grep -q 'My message'
register: grep_custom_html_top
failed_when: grep_custom_html_top.rc > 0
- name: Check custom html in home page content (bottom)
shell: # noqa 301

Check warning on line 77 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

77:14 [comments] too few spaces before comment

Check warning on line 77 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

77:14 [comments] too few spaces before comment
cmd: curl -sL http://localhost:4567 | grep -q 'Render custom string for this database'
register: grep_custom_html_bottom
failed_when: grep_custom_html_bottom.rc > 0
- name: Check that the home page is rendering the values of the placeholders set for my_db
shell: # noqa 301

Check warning on line 82 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

82:14 [comments] too few spaces before comment

Check warning on line 82 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Lint

82:14 [comments] too few spaces before comment
cmd: curl -sL http://localhost:4567 | grep -q '<a href="http://testplaceholder.com">my favorite link</a>'
register: grep_placeholder
failed_when: grep_placeholder.rc > 0
- name: Get the lib modified for hpc integration
slurp:
src: "/usr/local/share/gems/gems/sequenceserver-2.2.0/lib/sequenceserver/blast/job.rb"
src: "/usr/local/share/gems/gems/sequenceserver-3.1.2/lib/sequenceserver/blast/job.rb"
register: lib_modified_for_hpc_integration
- name: Display content of the lib modified for hpc integration
debug:
Expand Down
80 changes: 72 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,23 @@
when: (sequenceserver_logo_url is defined and sequenceserver_logo_url) or (sequenceserver_logo_path is defined and sequenceserver_logo_path)

- name: Modify source erb file for custom web page title and source lib for HPC integration | Set regexp | Default
set_fact:
sequenceserver_home_url_regexp: 'https://sequenceserver.com'
sequenceserver_home_url_replace: '{{ sequenceserver_home_url }}'
sequenceserver_logo_regexp: 'sequenceserver_logo.webp'
sequenceserver_logo_replace: '{{ sequenceserver_logo }}'
sequenceserver_title_regexp: '<%= SequenceServer::VERSION %>'
sequenceserver_title_replace: '<%= SequenceServer::WEB_PAGE_TITLE %>'
sequenceserver_support_regexp: 'https://sequenceserver.com/support'
sequenceserver_hpc_command_regexp: '(\s+def command\n.+\n.+\n\s+end\n)(\n\s+def raise!\n)'

- name: Modify source erb file for custom web page title and source lib for HPC integration | Set regexp | Version 2.2.0
set_fact:
sequenceserver_logo_title_regexp: '\s+<a\n\s+class="navbar-brand"\n\s+href="https://sequenceserver.com" target="_blank">\n\s+<img class="logo" src="SequenceServer_logo.png" alt="sequenceserver_logo">\n\s+<small>\n\s+<%= SequenceServer::VERSION %>\n\s+</small>\n\s+</a>' # noqa 204
sequenceserver_logo_title_replace: ' <a\n class="navbar-left"\n href="{{ sequenceserver_home_url }}" target="_blank">\n <img src="{{ sequenceserver_logo }}" alt="logo" height="40px" style="margin-top:5px;margin-right:30px;">\n </a>\n <div\n class="navbar-brand" style="margin-top:10px;">\n <%= SequenceServer::WEB_PAGE_TITLE %>\n </div>' # noqa 204
sequenceserver_support_regexp: 'https://www.sequenceserver.com/#support'
sequenceserver_hpc_command_regexp: '( def command\n.+\n.+\n end\n)(\n(?: #.*\n)+ def raise!\n)'
when: sequenceserver_version is defined and sequenceserver_version == "2.2.0"

- name: Modify source erb file for custom web page title and source lib for HPC integration | Set regexp | Version 2.0.0rc8
set_fact:
Expand All @@ -107,15 +119,41 @@
sequenceserver_hpc_command_regexp: '( def command\n.+\n.+\n end\n)(\n(?: #.*\n){4} def raise!\n)'
when: sequenceserver_version is defined and sequenceserver_version == "2.0.0.rc8"

- name: Modify source erb file for custom web page title | Customize logo, title, support email | Replace
- name: Modify source layout.erb file for custom web page title | Customize logo, title, support email | Replace | Default
replace:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page }}"
path: "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
backup: yes
with_items:
- {regexp: '{{ sequenceserver_home_url_regexp }}', replace: '{{ sequenceserver_home_url_replace }}'}
- {regexp: '{{ sequenceserver_logo_regexp }}', replace: '{{ sequenceserver_logo_replace }}'}
- {regexp: '{{ sequenceserver_title_regexp }}', replace: '{{ sequenceserver_title_replace }}'}
- {regexp: '{{ sequenceserver_support_regexp }}', replace: '{{ sequenceserver_support_email }}'}
when: sequenceserver_version is defined and sequenceserver_version != "2.2.0" and sequenceserver_version != "2.0.0.rc8"

- name: Modify source search_layout.erb file for custom web page title | Customize logo, title, support email | Replace | Default
replace:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page_second }}"
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
backup: yes
with_items:
- {regexp: '{{ sequenceserver_logo_regexp }}', replace: '{{ sequenceserver_logo_replace }}'}
- {regexp: '{{ sequenceserver_title_regexp }}', replace: '{{ sequenceserver_title_replace }}'}
- {regexp: '{{ sequenceserver_support_regexp }}', replace: '{{ sequenceserver_support_email }}'}
when: sequenceserver_version is defined and sequenceserver_version != "2.2.0" and sequenceserver_version != "2.0.0.rc8"

- name: Modify source erb file for custom web page title | Customize logo, title, support email | Replace | Version 2.2.0 or 2.0.0rc8
replace:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
backup: yes
with_items:
- {regexp: '{{ sequenceserver_logo_title_regexp }}', replace: '{{ sequenceserver_logo_title_replace }}'}
- {regexp: '{{ sequenceserver_support_regexp }}', replace: '{{ sequenceserver_support_email }}'}
when: sequenceserver_version is defined and (sequenceserver_version == "2.2.0" or sequenceserver_version == "2.0.0.rc8")

- name: Modify source erb file for custom web page title | Insert supplementary HTML code at the top of the web page | Check if the file exists
stat:
Expand All @@ -139,24 +177,50 @@
register: bottom_web_page_html_file
when: bottom_web_page_html_path.stat.exists

- name: Modify source erb file for custom web page title | Insert supplementary HTML code on the top of the web page | Insert or update with file content
- name: Modify source erb file for custom web page title | Insert supplementary HTML code on the top of the web page | Insert or update with file content | Default
blockinfile:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page }}"
path: "{{ item }}"
block: "{{ top_web_page_html_file['content'] | b64decode }}"
insertafter: "<body>"
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK - TOP -->"
backup: yes
when: top_web_page_html_path.stat.exists
with_items:
- "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
- "{{ sequenceserver_file_to_modify_for_custom_web_page_second }}"
when: top_web_page_html_path.stat.exists and sequenceserver_version is defined and sequenceserver_version != "2.2.0" and sequenceserver_version != "2.0.0.rc8"
notify: Restart all sequenceserver services

- name: Modify source erb file for custom web page title | Insert supplementary HTML code at the bottom of the web page | Insert or update with file content
- name: Modify source erb file for custom web page title | Insert supplementary HTML code at the bottom of the web page | Insert or update with file content | Default
blockinfile:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page }}"
path: "{{ item }}"
block: "{{ bottom_web_page_html_file['content'] | b64decode }}"
insertafter: "<%= yield %>"
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK - BOTTOM -->"
backup: yes
when: bottom_web_page_html_path.stat.exists
with_items:
- "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
- "{{ sequenceserver_file_to_modify_for_custom_web_page_second }}"
when: bottom_web_page_html_path.stat.exists and sequenceserver_version is defined and sequenceserver_version != "2.2.0" and sequenceserver_version != "2.0.0.rc8"
notify: Restart all sequenceserver services

- name: Modify source erb file for custom web page title | Insert supplementary HTML code on the top of the web page | Insert or update with file content | Version 2.2.0 or 2.0.0rc8
blockinfile:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
block: "{{ top_web_page_html_file['content'] | b64decode }}"
insertafter: "<body>"
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK - TOP -->"
backup: yes
when: top_web_page_html_path.stat.exists and (sequenceserver_version == "2.2.0" or sequenceserver_version == "2.0.0.rc8")
notify: Restart all sequenceserver services

- name: Modify source erb file for custom web page title | Insert supplementary HTML code at the bottom of the web page | Insert or update with file content | Version 2.2.0 or 2.0.0rc8
blockinfile:
path: "{{ sequenceserver_file_to_modify_for_custom_web_page_first }}"
block: "{{ bottom_web_page_html_file['content'] | b64decode }}"
insertafter: "<%= yield %>"
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK - BOTTOM -->"
backup: yes
when: bottom_web_page_html_path.stat.exists and (sequenceserver_version == "2.2.0" or sequenceserver_version == "2.0.0.rc8")
notify: Restart all sequenceserver services

- name: Add slurm_sbatch.sh for HPC integration (https://sequenceserver.com/doc/#hpc)
Expand Down
5 changes: 3 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ sequenceserver_ruby_download_url: "http://cache.ruby-lang.org/pub/ruby/3.3/ruby-
sequenceserver_gem_install_dir: "{{ sequenceserver_gem_root_path }}/usr/local/share/gems"
# Absolute path to the directory where the logo image is copied
sequenceserver_web_public_repository: "{{ sequenceserver_gem_install_dir }}/gems/sequenceserver-{{ sequenceserver_version }}/public"
# File that is modified to customize the blast server (logo, title and support link)
# Files that are modified to customize the blast server (logo, title and support link)
# Need sequenceserver version >= 2.0.0
sequenceserver_file_to_modify_for_custom_web_page: "{{ sequenceserver_gem_install_dir }}/gems/sequenceserver-{{ sequenceserver_version }}/views/layout.erb"
sequenceserver_file_to_modify_for_custom_web_page_first: "{{ sequenceserver_gem_install_dir }}/gems/sequenceserver-{{ sequenceserver_version }}/views/layout.erb"
sequenceserver_file_to_modify_for_custom_web_page_second: "{{ sequenceserver_gem_install_dir }}/gems/sequenceserver-{{ sequenceserver_version }}/views/search_layout.erb"
# File that is modified for HPC integration (SLURM)
# Need sequenceserver version >= 2.0.0
sequenceserver_lib_to_modify_for_hpc_integration: "{{ sequenceserver_gem_install_dir }}/gems/sequenceserver-{{ sequenceserver_version }}/lib/sequenceserver/blast/job.rb"
Expand Down