Commit Graph
36996 Commits
Author SHA1 Message Date
Nicola Soranzo e975ca3754 Update to black 2024 stable style 2024-01-30 18:09:51 +00:00
Marius van den BeekandNicola Soranzo d08044c50b Define variables
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2024-01-30 17:32:49 +01:00
mvdbeek e9d7b18d41 Adapt to upstream FileResponse logic
The ``send_header_only`` attribute has been removed in starlette
(https://github.com/encode/starlette/pull/2366), and replaced with
`scope["method"].upper() == "HEAD"`
2024-01-30 16:39:22 +01:00
galaxybot 0c0da9c821 Update Python dependencies 2024-01-30 16:39:21 +01:00
Nuwan Goonasekera 431429c749 Merge pull request #17385 from ahmedhamidawan/minor_oidc_backends_comment_bug
Fix minor oidc_backends_config comment bug
2024-01-30 12:56:17 +05:30
Ahmed Awan 409d8a42ae Fix minor oidc_backends_config comment bug
The comment for `<accepted_audiences>` in `oidc_backend_config` causes an error when starting Galaxy.
2024-01-29 13:08:48 -06:00
John Davis e134e8b633 Merge branch 'release_23.2' into 'release_23.3' 2024-01-29 13:27:15 -05: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
Marius van den Beek 5c6dd8eb4b Merge pull request #17367 from nsoranzo/lxml-stubs
Fix type annotation of code using XML etree
2024-01-29 16:19:16 +01:00
Nicola Soranzo 9a682d4373 Add assertion message 2024-01-29 14:14:14 +00:00
Nicola Soranzo 237626edc0 Fix type annotation of `BaseJobExec.parse_status()` 2024-01-29 13:49:35 +00:00
mvdbeek e4147f78f1 Add explicit cache_ok attribute to JSONType subclass
As for the other JSONType subclasses this is safe.
2024-01-29 10:31:20 +01:00
Nicola Soranzo 37116c39a0 Fix type annotation of code using XML etree
by adding lxml-stubs to our typecheck requirements.
2024-01-26 18:41:09 +00:00
Matthias Bernt 7530fb4dc2 Revert "Escape pipe character"
This reverts commit 4152c350db.
2024-01-26 18:40:13 +01:00
John Davis 6f7f8b0d2a Merge pull request #17361 from mvdbeek/drop_unused_wildcard_replacement
Remove unused statements in job search function
2024-01-26 09:32:54 -05:00
mvdbeek a0f69c5375 Remove unused statements in job search function 2024-01-26 11:51:09 +01:00
Cameron Hyde 4152c350db Escape pipe character 2024-01-26 10:38:36 +10:00
Nate Coraor add8b28efa Write to a temp filename in posix file source plugin 2024-01-24 15:08:18 -05:00
John Davis 568480f923 Merge branch 'release_23.2' into dev_merge_23.2 2024-01-24 16:28:01 +00: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
Nicola Soranzo 12ad482d66 Fix B038 errors reported by flake8-bugbear 24.1.17 2024-01-22 20:33:47 +00:00
Nicola Soranzo fd5102dd1d Fix B036 errors reported by flake8-bugbear 24.1.17 2024-01-22 20:33:46 +00:00
Nicola Soranzo a11f77d4be Merge pull request #17335 from davelopez/fix_quotas_id_encoding
Fix quotas ID encoding
2024-01-22 18:34:38 +00:00
davelopez 0b4df0f37b Fix quotas id encoding 2024-01-22 12:23:56 +01:00
Ubuntu 6860c9a0fb Add support for Python 3.12 2024-01-21 11:57:59 +00:00
Nicola Soranzo 30a6aab6c9 Workaround `ImportError for importlib.resources.Anchor`
xref: https://github.com/python/cpython/issues/113238
2024-01-21 10:31:16 +00:00
Nicola Soranzo 76e566d1e1 Fix E231 flake8 error in f-string 2024-01-21 10:31:16 +00:00
Ubuntu cc878ba75f Update comments 2024-01-20 22:12:06 +00:00
Björn Grüning 5f25a48ac9 Merge pull request #17311 from bgruening/s3fs-templating
[23.2] fix s3fs templating
2024-01-20 10:56:38 +01:00
nuwang 000246826e Also pop bucket name during get and write to filesource 2024-01-19 22:50:07 +05:30
Marius van den Beek f12984bf37 Merge pull request #17324 from pcm32/patch-13
Enable job resubmissions in k8s runner
2024-01-18 14:59:45 +01:00
mvdbeek e02a765b7b Merge branch 'release_23.2' into dev 2024-01-18 12:23:00 +01:00
Bjoern Gruening 29d7820cb3 fix linting 2024-01-18 11:42:17 +01:00
Bjoern Gruening a75422d9c8 ls() can not handle the bucket in its arguments 2024-01-18 11:38:59 +01:00
nuwang 7392c6b70d Move _bucket initializer to open_fs, following GoogleCloudStorageFilesSource 2024-01-18 11:36:30 +01:00
Björn Grüning 625ae9700f bucket needs special handling 2024-01-18 11:36:30 +01:00
Björn Grüning 488d2838e9 Update s3fs.py 2024-01-18 11:36:30 +01:00
Björn Grüning 89f02ff060 fix s3fs templating 2024-01-18 11:36:30 +01:00
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 274a1549be Merge branch 'release_23.2' into dev 2024-01-17 10:59:22 +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
John Davis 34fd0bdeee Merge pull request #17312 from jdavcs/23.2_pendingrollbackerror2
[23.2] Rollback invalidated transaction: catch them earlier
2024-01-16 17:36:20 -05:00
John Davis c744ca3ae0 Remove redundant db connection check 2024-01-16 15:54:20 -05:00