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

v5.8.6+galaxy0 #26

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

v5.8.6+galaxy0 #26

wants to merge 19 commits into from

Conversation

RJMW
Copy link
Member

@RJMW RJMW commented Jul 30, 2024

No description provided.

@bernt-matthias
Copy link
Collaborator

FYI OpenMS/OpenMS#7000 (comment)

This registration thing in Sirius is really super annoying. Also sirius being kind of a black box always did not feel right for me.

@RJMW
Copy link
Member Author

RJMW commented Jul 30, 2024

@bernt-matthias - Thank you for informing me about the Sirius OpenMS implementation. Although the registration process isn't ideal, the tool appears to be popular within the Metabolomics community. I have received several requests, including W4M.

While I managed to get the testing to work locally using Planemo, integrating it with the Galaxy GitHub workflow has proven to be somewhat tricky. I am still keen to see if I can get the CI tests to work.

I am using a similar approach to the one used for genome annotation tools, specifically Apollo. See here

Your review or input is more than welcome.

@RJMW RJMW requested review from bgruening and bernt-matthias July 30, 2024 15:50
Comment on lines +46 to +49
cmd_login = "sirius login " \
"--user='{}' " \
"--password='{}'".format(credentials["username"],
credentials["password"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cmd_login = "sirius login " \
"--user='{}' " \
"--password='{}'".format(credentials["username"],
credentials["password"])
cmd_login = f"sirius login --user='{credentials["username"]}' --password='{credentials["password"]}'"

f-string are the new cool stuff :)

paramd["cli"]["--profile"],
paramd["cli"]["--database"]
)
"fingerprint " \
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe also use f-string here?

.github/styler.R Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Those are IUC updates, correct? Maybe put them into a separate PR so we know what belongs to this PR?

(I assume you need to change CI for testing as well)

echo "Credentials for Sirius are available via: User -> Preferences -> Manage Information"
#else:
echo "Running Sirius as user: $username" &&
export _JAVA_OPTIONS=-Duser.home=$__new_file_path__ &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should not write into __new_file_path__ random stuff. Can you use there \$PWD?

--candidates $candidates
--ppm_max $ppm_max
--polarity $polarity
--out_dir $__new_file_path__
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
--out_dir $__new_file_path__
--out_dir ./

Better?

--meta_select_col $meta_select_col
--min_MSMS_peaks $min_MSMS_peaks
--schema $schema
--temp_dir $__new_file_path__
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
--temp_dir $__new_file_path__
--temp_dir ./

Comment on lines +9 to +11
# group runs by PR, but keep runs on main separate
# because we do not want to cancel toolshed uploads
group: pr-${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.run_number || github.ref }}
group: pr-${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main') && github.run_number || github.ref }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can leave this as it is. It covers main and master

@RJMW
Copy link
Member Author

RJMW commented Jul 31, 2024

@bernt-matthias @bgruening - Thank you for your swift reviews.

Could you help me understand why the arguments for Planemo are resulting in the incorrect order, see here

I am using the additional-planemo-options argument for planemo to include a specific job_config that includes env variables, see here. This approach seems to work for this particular tool. Although the ci logs are not available anymore.

with:
mode: test
repository-list: ${{ needs.setup.outputs.repository-list }}
galaxy-fork: ${{ env.GALAXY_FORK }}
galaxy-branch: ${{ env.GALAXY_BRANCH }}
chunk: ${{ matrix.chunk }}
chunk-count: ${{ needs.setup.outputs.chunk-count }}
additional-planemo-options: --job_config_file "${{ github.workspace }}/config/job_conf_planemo_subst.xml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test currently fails with

Error: Invalid value for '--job_config_file': File '"/home/runner/work/sirius-csifingerid-galaxy/sirius-csifingerid-galaxy/config/job_conf_planemo_subst.xml"' does not exist.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In case you want to debug danielr1996/[email protected] you could just execute the command used in the action: https://github.com/danielr1996/envsubst-action/blob/b10d6e6eb5dba1c22527571460ceb83bc17c0b28/entrypoint.sh#L3

<param id="docker_sudo">false</param>
<param id="docker_sudo_cmd">sudo</param>
<param id="docker_cmd">docker</param>
<param id="docker_run_extra_arguments">-e USERNAME_SIRIUS='${USERNAME_SIRIUS}' -e PASSWORD_SIRIUS='${PASSWORD_SIRIUS}'</param>
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can set env vars for containers like so:

            <param id="docker_env_USERNAME_SIRIUS">'${USERNAME_SIRIUS}'</param>
            <param id="docker_env_PASSWORD_SIRIUS">'${USERNAME_SIRIUS}'</param>

galaxyproject/galaxy#16666

@@ -32,13 +32,23 @@
parser.add_argument('--schema', default='msp')
parser.add_argument('-a', '--adducts', action='append', nargs=1,
required=False, default=[], help='Adducts used')
parser.add_argument('--credentials')
Copy link
Collaborator

Choose a reason for hiding this comment

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

help would be nice.

"--user='{}' " \
"--password='{}'".format(credentials["username"],
credentials["password"])
os.system(cmd_login)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using subprocess might be better: https://docs.python.org/3/library/subprocess.html

#set $username = $__user__.extra_preferences.get('sirius_account|username', "")
#end if
#if $username == "":
echo "Credentials for Sirius are available via: User -> Preferences -> Manage Information"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
echo "Credentials for Sirius are available via: User -> Preferences -> Manage Information"
>&2 echo "Credentials for Sirius are available via: User -> Preferences -> Manage Information";
exit 1

#if $username == "":
echo "Credentials for Sirius are available via: User -> Preferences -> Manage Information"
#else:
echo "Running Sirius as user: $username" &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we expose this info to the user (e.g. in the case it's set by the admin via env vars)?

@bernt-matthias
Copy link
Collaborator

Could you help me understand why the arguments for Planemo are resulting in the incorrect order, see here

What do you mean with wrong order?

My guess would be that the use of single and double quotes in --job_config_file '"/home/runner/work/sirius-csifingerid-galaxy/sirius-csifingerid-galaxy/config/job_conf_planemo_subst.xml"' is the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants