Skip to content

Run local galaxy via gravity#1232

Merged
jmchilton merged 23 commits intogalaxyproject:masterfrom
mvdbeek:planemo_gravity
Sep 23, 2022
Merged

Run local galaxy via gravity#1232
jmchilton merged 23 commits intogalaxyproject:masterfrom
mvdbeek:planemo_gravity

Conversation

@mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented May 9, 2022

This drops the run_tests.sh mode completely and leads to a lot of simplification of the code.

@mvdbeek mvdbeek force-pushed the planemo_gravity branch 2 times, most recently from 7d20a94 to 4c2e268 Compare May 10, 2022 17:05
@mvdbeek mvdbeek force-pushed the planemo_gravity branch 2 times, most recently from 1e5dd9d to 3eb9ce6 Compare May 24, 2022 11:34
@nsoranzo
Copy link
Member

@mvdbeek The unit test failures are legit, I think you mention you already have fixes for them?

@nsoranzo nsoranzo mentioned this pull request May 25, 2022
8 tasks
@mvdbeek
Copy link
Member Author

mvdbeek commented May 26, 2022

I'm working on this, yes.

@mvdbeek mvdbeek added the wip label May 26, 2022
@mvdbeek mvdbeek force-pushed the planemo_gravity branch from 3c57424 to d7ff612 Compare May 26, 2022 14:29
@nsoranzo
Copy link
Member

Q: with this, we are dropping support for serving/testing on Galaxy pre 22.01, right?

In that case, we should replace unit-nonredundant-noclientbuild-noshed-gx-2105 and unit-nonredundant-noclientbuild-noshed-gx-2109 tox envs with unit-nonredundant-noclientbuild-noshed-gx-2201 in .github/workflows/ci.yaml (and similarly in tox.ini).

@mvdbeek
Copy link
Member Author

mvdbeek commented May 27, 2022

Q: with this, we are dropping support for serving/testing on Galaxy pre 22.01, right?

No, I will re-introduce the necessary parts. That shouldn't be a big deal, that was just for me to get started.

@mvdbeek mvdbeek force-pushed the planemo_gravity branch 3 times, most recently from d830e7d to 775000b Compare May 30, 2022 13:18
@mvdbeek mvdbeek force-pushed the planemo_gravity branch from 5c88a03 to 7aa80ab Compare May 30, 2022 13:43
mvdbeek added 2 commits May 30, 2022 15:54
Galaxy will figure this out (dev wheels on dev), and since we don't use
run_tests.sh we shouldn't need any dev wheels.
Previously only worked for test run via run_test.sh, should now work
anywhere the option is included.
@mvdbeek mvdbeek force-pushed the planemo_gravity branch from 7495bb6 to 36eb798 Compare May 31, 2022 11:20
Copy link
Member

@nsoranzo nsoranzo left a comment

Choose a reason for hiding this comment

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

Maybe we should pass the timeout to _run() as well, even if not used yet? Feel free to discard if it doesn't make sense!

job_paths.append(test_case.job_path)
try:
run_response = self._run(runnable, job_path)
run_responses = self._run(runnables, job_paths)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run_responses = self._run(runnables, job_paths)
run_responses = self._run(runnables, job_paths, timeout=test_timeout)

return run_responses

@abc.abstractmethod
def _run(self, runnable, job_path):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def _run(self, runnable, job_path):
def _run(self, runnable, job_path, timeout=None):

if self._ctx.verbose:
self._ctx.log("Running Galaxy with API configuration [%s]" % config.user_api_config)
run_response = execute(self._ctx, config, runnable, job_path, **self._kwds)
def _run(self, runnables, job_paths):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def _run(self, runnables, job_paths):
def _run(self, runnables, job_paths, timeout=None):

@mvdbeek
Copy link
Member Author

mvdbeek commented May 31, 2022

It is used in _run for Galaxy Engines via

run_response = execute(self._ctx, config, runnable, job_path, **self._kwds)
. If we pass the kwds explicitly we'd have to make a copy of the dict so we're not passing the argument twice ... my first version did pass the timeout argument to _run but that didn't look much better to me.

`problem_log` is an optional property that we only fill if we have
galaxy logs.
@mvdbeek mvdbeek force-pushed the planemo_gravity branch from 3691b38 to 140c4bf Compare May 31, 2022 13:33
@mvdbeek mvdbeek removed the wip label May 31, 2022
@mvdbeek
Copy link
Member Author

mvdbeek commented May 31, 2022

It's green!

)
action = "Testing tools"
return_code = run(ctx, cmd, config.env, action)
if return_code != 0 and kwds.get("update_test_data", False):
Copy link
Member

Choose a reason for hiding this comment

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

--update_test_data does not work when I test locally (seems to be no test for it)

Copy link
Member Author

Choose a reason for hiding this comment

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

Support for this was always partial (no discovered datasets, breaks for contains, from_work_dir etc). How bad would it be to drop this for now and maybe re-implement later?

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be pretty bad to drop it permanently tbh. That option is quite useful.

If it can't go in this PR, I can re-implement it in a new PR (hopefully a more comprehensive version), but I think we shouldn't make a new release without it.

return_code = run(ctx, cmd, config.env, action)

_check_test_outputs(xunit_report_file_tracker, structured_report_file_tracker)
test_results = test_structures.GalaxyTestResults(
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer used but still in the code base... are we certain the stuff it is doing is being replicated in tool-util? Unfortunately this seems like a question for @jmchilton 😿.

assert (
float(tool_test_json["tests"][0]["data"]["time_seconds"]) <= 10
), "Test needed more than 10 sec but should time out after 1"
assert "Timed out after" in tool_test_json["tests"][0]["data"]["problem_log"], "Time out did not happen"
Copy link
Member

Choose a reason for hiding this comment

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

This scares me - these logs were being cleaned up and merged by code removed? This will cause a degradation in the reports? Again... a question for me...

Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW we dump that in https://github.com/mvdbeek/galaxy/blob/3aed09379875dc48610fbe86b897d03c6b74b143/lib/galaxy/tool_util/verify/interactor.py#L1271. So workflow tests or tests against external engines have used this for years at this point.

@mvdbeek
Copy link
Member Author

mvdbeek commented Sep 21, 2022

I remember now that one of the concerns I had at the time is that I'm not sure we're always correctly shutting down all processes managed by gravity ... unit tests seemed to leave me with lingering processes IIRC.

@jmchilton jmchilton merged commit 969e590 into galaxyproject:master Sep 23, 2022
@jmchilton
Copy link
Member

Thanks for pushing us forward @mvdbeek - these are really really important changes and simplify things very nicely.

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.

Planemo should not call run_tests.sh

4 participants