Commit Graph
36449 Commits
Author SHA1 Message Date
Ahmed Hamid AwanandJohn Davis 5ffa9e153b move database_connection assignment after super()...
Co-authored-by: John Davis <jdavcs@gmail.com>
2024-01-30 13:57:09 -06:00
Aysam Guerler 34fab93f75 Merge pull request #17338 from ahmedhamidawan/upload_modal_loses_content
[23.2] Fix upload modal loses its content when closed
2024-01-30 10:50:21 -05:00
Ahmed Awan 3e94c4d3db check dbkey: [".."] as well, fix mypy errors 2024-01-30 07:39:42 -06:00
davelopez 5153394f15 Set webdav plugin to use temp files by default
it avoids the issue with loading the entire files into memory.
2024-01-30 13:43:09 +01:00
davelopez ddf992cbfd Add comment on writable for webdav file source 2024-01-30 13:41:21 +01:00
davelopez 1a81f7590f Update docs for webdav file source config
Include docs and settings to avoid loading entire files into memory.
2024-01-30 12:23:17 +01:00
Ahmed Awan 38b1107574 [23.0] Fix History contents genome_build filter postgresql bug
Check the user's db connection and use appropriate query/function.
2024-01-29 12:43:27 -06:00
John Davis a1088bc0e2 Update version to 23.2.1.dev0 2024-01-29 13:27:14 -05:00
John Davis 9c593cd0ce Update version to 23.2. 2024-01-29 13:27:13 -05:00
Nate Coraor add8b28efa Write to a temp filename in posix file source plugin 2024-01-24 15:08:18 -05:00
Ahmed Awan fe353dc405 add selenium test for upload modal not losing content on close
This selenium makes sure that when users reopen upload modal, the content from prior or inprogress uploads is still there
2024-01-24 17:23:39 +05:00
mvdbeek a3e70c6eb6 Only switch out compressor if deflate requested 2024-01-23 11:46:59 +01:00
mvdbeek a4b14be89e Work around no unused ignores 2024-01-23 11:35:14 +01:00
mvdbeek 7e9c02b75c Use python-isal for fast zip deflate compression in rocrate export 2024-01-23 11:16:26 +01:00
Nuwan Goonasekera 61f3db22e4 Revert "[23.1] Enable job resubmissions in k8s runner" 2024-01-18 17:17:32 +05:30
Nuwan Goonasekera b4b1defdc5 Merge pull request #15238 from pcm32/patch-13
[23.2] Enable job resubmissions in k8s runner
2024-01-18 15:14:43 +05:30
mvdbeek e55a09955b Scope session for job runner monitor loop
I think this is as closed as we can get to
```
try:
    <use session>
    session.commit()
except:
   session.rollback()
   raise
finally:
   session.close()  # optional, depends on use case
```
mentioned in https://docs.sqlalchemy.org/en/14/faq/sessions.html#this-session-s-transaction-has-been-rolled-back-due-to-a-previous-exception-during-flush-or-similar
2024-01-17 18:19:04 +01:00
John Davis b9ba44bc10 Merge pull request #17315 from mvdbeek/backport_23.2_pendingrollbackerror2
[23.2] Backport Rollback invalidated transaction: catch them earlier
2024-01-17 09:28:08 -05:00
mvdbeek a88dbdd177 Discard connection after task completion
Running the test without removing the session yields:
```
celery.app.trace ERROR 2024-01-17 11:49:42,502 [pN:main,p:81158,tN:Thread-2 (start)] Task integration.test_celery_tasks.use_session[0f89df2c-4960-4aac-8e1a-ce431dae6749] raised unexpected: PendingRollbackError("Can't reconnect until invalid transaction is rolled back.")
Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/lib/galaxy/celery/__init__.py", line 181, in wrapper
    rval = app.magic_partial(func)(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/lagom/wrapping.py", line 28, in _bound_func
    return inner_func(*bound_args, **bound_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/lagom/wrapping.py", line 45, in _error_handling_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/test/integration/test_celery_tasks.py", line 42, in use_session
    sa_session().query(HistoryDatasetAssociation).get(1)
  File "<string>", line 2, in get
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 468, in warned
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 947, in get
    return self._get_impl(ident, loading.load_on_pk_identity)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 951, in _get_impl
    return self.session._get_impl(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2975, in _get_impl
    return db_load_fn(
           ^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/loading.py", line 530, in load_on_pk_identity
    session.execute(
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
    conn = self._revalidate_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 650, in _revalidate_connection
    self._invalid_transaction()
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 622, in _invalid_transaction
    raise exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)
FAILEDINFO:     127.0.0.1:59776 - "GET /api/jobs?state=running HTTP/1.1" 200 OK
```

The fix here is to set a unique scope for the session registry.
This means that the task is guranteed to get a new, unshared session,
and this session gets removed after completing the task.

The docstring of session.remove says:
```
       This will first call :meth:`.Session.close` method
        on the current :class:`.Session`, which releases any existing
        transactional/connection resources still being held; transactions
        specifically are rolled back.  The :class:`.Session` is then
        discarded.   Upon next usage within the same scope,
        the :class:`.scoped_session` will produce a new
        :class:`.Session` object.
```
which I think is what we want after every celery task (for now, at least).
It might make sense to discard the session for any long-running task
that doesn't require database access in the future.

Fix scope
2024-01-17 12:41:43 +01:00
mvdbeek 8118f07d81 Merge branch 'release_23.1' into release_23.2 2024-01-17 10:57:25 +01:00
John Davis a4d0c33972 Remove redundant db connection check 2024-01-17 10:54:10 +01:00
John Davis 9bae0a06a4 Check db connection for invalid transactions in runner's monitor loop 2024-01-17 10:54:09 +01:00
Marius van den BeekandNicola Soranzo 6c42b169e9 Fix kombu version
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2024-01-16 19:13:25 +01:00
mvdbeek b7f90ec87d Install newer celery on python 3.8+
Latest celery fixes exception reporting, but doesn't work on python 3.7.
I'm only adding this to {pinned,dev}-requirements.txt. When merging forward
we can drop the 3.7 dependency.
2024-01-16 19:08:39 +01:00
Marius van den Beek 7f057c9331 Merge pull request #17268 from mvdbeek/fix_element_not_copied
[23.1] Always copy datasets in collection builder modals
2024-01-16 14:58:12 +01:00
mvdbeek a2cb91487a Merge branch 'release_23.1' into release_23.2 2024-01-15 12:05:09 +01:00
John Davis d1d8b08a20 Add one more check for invalidated transaction 2024-01-13 16:17:42 -05:00
John Davis cf53c05fd1 Log an error message 2024-01-13 11:01:27 -05:00
John Davis cb01378faa Rollback invalidated transaction 2024-01-12 16:05:40 -05:00
mvdbeek 01502917f7 Fix `to_cwl` for nested collections
Fixes
```
TypeError
Object of type DatasetCollection is not JSON serializable
```
seen when running https://github.com/galaxyproject/iwc/pull/315
2024-01-12 12:24:59 +01:00
mvdbeek e4f8315c2b Adjust selenium tests for new numbering 2024-01-11 13:34:29 +01:00
Marius van den Beek c3e53c499d Merge pull request #17117 from bernt-matthias/fix/tool_panel_dups_in_section
[23.1] Remove duplicates when copying sections for tool panel view
2024-01-11 09:56:19 +01:00
Alexander OSTROVSKY db9cd1cd49 add binary datatypes for intermediate output of fastk tools 2024-01-11 09:46:15 +01:00
John Davis 5597d9f718 Merge pull request #16883 from mvdbeek/copy_nonsense_tool_version
[23.1] Add back 1.1.0 version of Filtering1 tool
2024-01-10 14:07:14 -05:00
mvdbeek 20e560c2e2 Start work on 23.1.5.dev0 2024-01-04 16:15:18 +01:00
mvdbeek 5dccc48db7 Create version 23.1.4 2024-01-04 16:15:11 +01:00
mvdbeek bc5259f5d2 Merge branch 'release_23.1' into release_23.2 2024-01-04 16:02:16 +01:00
Marius van den Beek d0a7562ad7 Merge pull request #17236 from mvdbeek/fix_schema_integrity
[23.1] Separate collection and non-collection data element
2024-01-02 20:41:31 +02:00
mvdbeek b1361c8e79 Separate collection and non-collection data element
in tool schema. New lxml is more strict when validating
the xml schema and fails with

```
lxml.etree.XMLSchemaParseError: complex type 'Output': The content model is not determinist., line 5329
```

this is because `filter` and `discover_datasets` are present in
OutputDataElement and OutputCollectionElement, making

```
     <xs:sequence>
       <xs:group ref="OutputDataElement" minOccurs="0" maxOccurs="unbounded" />
       <xs:group ref="OutputCollectionElement" minOccurs="0" maxOccurs="unbounded" />
     </xs:sequence>
```

not deterministic.

In any case this isn't an accurate model of what is allowed and parsed,
as you can't use collection-specific discover_datasets options outside
of a dataset collection.

I **think** that the reason for adding
OutputCollectionElement to the sequence is that you can have a `data`
element nested in a `collection` element.

To continue allowing this and making it more precise I've added an
additional `OutputCollectionDataElement` type that is allowed within
`collection`. This then should allow us to remove
`OutputCollectionElement` from the `OutputData` type.

A quick test against IUC and devteam revealed no problem with this
approach per se, however it showed that https://github.com/galaxyproject/tools-iuc/blob/aa8360cb3ec9faf1488938a430855977632706ff/tools/krakentools/extract_kraken_reads.xml#L145
uses `change_format` which is not implemented for collections.
2023-12-31 19:59:17 +02:00
mvdbeek 8bab912a7f Move display application link test to integration test 2023-12-25 10:38:21 +01:00
mvdbeek 0b951643f4 Don't fail CONVERTER_fasta_to_fai with stderr contents 2023-12-25 10:35:43 +01:00
mvdbeek 21bfb0c490 Test and fix display application link handling 2023-12-25 09:37:19 +01:00
mvdbeek f7b7409ea8 Add dbkey to DatasetLikeObject 2023-12-24 10:30:41 +01:00
mvdbeek 7105af4917 Merge branch 'release_23.1' into release_23.2 2023-12-23 15:17:49 +01:00
Marius van den Beek 4fa0403fed Merge pull request #17227 from mvdbeek/fix_display_applications
[23.2] Fix Display Application link generation
2023-12-23 15:13:08 +01:00
Björn Grüning 687bcf9d01 Merge pull request #17231 from mvdbeek/convert_test_backport
[23.1] Backport #17188: Fix for converter tests
2023-12-23 12:43:56 +01:00
mvdbeek 1113f4c744 Fix User.current_galaxy_session 2023-12-23 10:34:11 +01:00
Matthias Bernt 07bf0d6955 Also fix test of the vcf_to_vcf_bgzip_converter 2023-12-23 10:27:01 +01:00
Matthias Bernt dc8275cb86 slighly more intrusive fix 2023-12-23 10:27:01 +01:00
Matthias Bernt e4993e6d88 unintrusive fix for converter tests 2023-12-23 10:27:00 +01:00