Commit Graph
1904 Commits
Author SHA1 Message Date
Nicola Soranzo 26a4e146e0 Fix UP031 errors
reported by ruff 0.8.0 .
2024-11-24 21:35:23 +00:00
Nate Coraor 235e4ce5c3 Update static handling for welcome.html to automatically load sample if
the non-sample is not present, and for installed Galaxy. Fix robots.txt
and favicon which were not served at all due to middleware.
2024-10-24 13:17:40 -04:00
mvdbeek 3d17e97760 Merge branch 'release_24.1' into dev 2024-09-20 10:53:21 +02:00
John Chilton 307acd972f Add migration that makes dataset uuid unique
and enforces a unique constraint.
Also incldues a script to update purged status for affected datasets
that are not in any object store.
2024-09-20 10:40:12 +02:00
mvdbeek 9da413cf7b Merge branch 'release_24.1' into dev 2024-09-19 11:39:11 +02:00
mvdbeek ec48f50877 Fix wrong celery_app config on job and workflow handlers
Fixes https://github.com/galaxyproject/galaxy/issues/18727 /
https://sentry.galaxyproject.org/share/issue/8091a452f32645b89b37976362779532/:
```
Message
(59965185/49195886) Job wrapper finish method failed
Stack Trace

Newest

OperationalError: unable to open database file
  File "sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
  File "sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
  File "sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
  File "sqlalchemy/pool/impl.py", line 179, in _do_get
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/impl.py", line 177, in _do_get
    return self._create_connection()
  File "sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
  File "sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
  File "sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/20/e3q8)
  File "kombu/connection.py", line 472, in _reraise_as_library_errors
    yield
  File "kombu/connection.py", line 556, in _ensured
    return fun(*args, **kwargs)
  File "kombu/messaging.py", line 202, in _publish
    [maybe_declare(entity) for entity in declare]
  File "kombu/messaging.py", line 202, in <listcomp>
    [maybe_declare(entity) for entity in declare]
  File "kombu/messaging.py", line 107, in maybe_declare
    return maybe_declare(entity, self.channel, retry, **retry_policy)
  File "kombu/common.py", line 113, in maybe_declare
    return _maybe_declare(entity, channel)
  File "kombu/common.py", line 153, in _maybe_declare
    entity.declare(channel=channel)
  File "kombu/entity.py", line 617, in declare
    self._create_queue(nowait=nowait, channel=channel)
  File "kombu/entity.py", line 626, in _create_queue
    self.queue_declare(nowait=nowait, passive=False, channel=channel)
  File "kombu/entity.py", line 655, in queue_declare
    ret = channel.queue_declare(
  File "kombu/transport/virtual/base.py", line 537, in queue_declare
    self._new_queue(queue, **kwargs)
  File "kombu/transport/sqlalchemy/__init__.py", line 159, in _new_queue
    self._get_or_create(queue)
  File "kombu/transport/sqlalchemy/__init__.py", line 138, in _get_or_create
    obj = self.session.query(self.queue_cls) \
  File "kombu/transport/sqlalchemy/__init__.py", line 133, in session
    _, Session = self._open()
  File "kombu/transport/sqlalchemy/__init__.py", line 125, in _open
    metadata.create_all(engine)
  File "sqlalchemy/sql/schema.py", line 5857, in create_all
    bind._run_ddl_visitor(
  File "sqlalchemy/engine/base.py", line 3250, in _run_ddl_visitor
    with self.begin() as conn:
  File "contextlib.py", line 137, in __enter__
    return next(self.gen)
  File "sqlalchemy/engine/base.py", line 3240, in begin
    with self.connect() as conn:
  File "sqlalchemy/engine/base.py", line 3276, in connect
    return self._connection_cls(self)
  File "sqlalchemy/engine/base.py", line 148, in __init__
    Connection._handle_dbapi_exception_noconnection(
  File "sqlalchemy/engine/base.py", line 2440, in _handle_dbapi_exception_noconnection
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
  File "sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
  File "sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
  File "sqlalchemy/pool/impl.py", line 179, in _do_get
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/impl.py", line 177, in _do_get
    return self._create_connection()
  File "sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
  File "sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
  File "sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/20/e3q8)
  File "galaxy/jobs/runners/__init__.py", line 677, in _finish_or_resubmit_job
    job_wrapper.finish(
  File "galaxy/jobs/__init__.py", line 2070, in finish
    task_wrapper.delay()
  File "celery/canvas.py", line 353, in delay
    return self.apply_async(partial_args, partial_kwargs)
  File "celery/canvas.py", line 400, in apply_async
    return _apply(args, kwargs, **options)
  File "celery/app/task.py", line 594, in apply_async
    return app.send_task(
  File "celery/app/base.py", line 801, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "celery/app/amqp.py", line 518, in send_task_message
    ret = producer.publish(
  File "kombu/messaging.py", line 186, in publish
    return _publish(
  File "kombu/connection.py", line 553, in _ensured
    with self._reraise_as_library_errors():
  File "contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "kombu/connection.py", line 476, in _reraise_as_library_errors
    raise ConnectionError(str(exc)) from exc
```
The issue was that we aren't setting `GALAXY_CONFIG_FILE` if the job and
workflow handlers are started with `-c path/to/galaxy.yml`, and the
celery config heuristic isn't looking at sys.argv.
2024-09-16 19:11:18 +02:00
davelopez 985184b458 Fix import issue in bootstrap_test_shed.py
$ make bootstrap_test_backend
cd ../../../..; . .venv/bin/activate; python scripts/bootstrap_test_shed.py
Traceback (most recent call last):
  File "/galaxy/scripts/bootstrap_test_shed.py", line 20, in <module>
    from galaxy.util import requests
ModuleNotFoundError: No module named 'galaxy'
make: *** [Makefile:22: bootstrap_test_backend] Error 1
2024-07-12 17:23:08 +02:00
mvdbeek 0122cdb16e Merge branch 'release_24.0' into release_24.1 2024-06-05 17:43:18 +02:00
mvdbeek 7228c5aad1 Merge branch 'release_23.2' into release_24.0 2024-06-05 15:25:29 +02:00
mvdbeek fed2294c1b Merge branch 'release_23.1' into release_23.2 2024-06-05 10:03:56 +02:00
mvdbeek 06b8db47ba Change hardcoded repo location in more place 2024-05-31 11:36:59 +02:00
mvdbeek 093dcc8d3d Merge branch 'release_24.0' into release_24.1 2024-05-28 14:34:20 +02:00
Nicola Soranzo 8cdca0f343 Revert some requests import changes
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.

Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
2024-05-23 15:55:56 +01:00
John Davis 04e77ef134 Remove legacy ref to sqlalchemy migrate 2024-05-22 14:57:53 -04:00
John Chilton 2f43c32fd9 Merge pull request #18003 from mvdbeek/add_galaxy_to_user_agent
Add galaxy to user agent
2024-05-20 12:14:13 -04:00
Nicola Soranzo 534010a8cb Enable flake8-implicit-str-concat ruff rules
See https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
2024-04-29 13:37:54 +01:00
Nicola Soranzo 0629908541 Fix new UP031 errors from ruff 0.4.2 2024-04-29 00:09:38 +01:00
mvdbeek e8a3b8c0cd Create wrapper for requests with default user agent 2024-04-16 17:54:29 +02:00
John Davis bf62b25eee Merge pull request #17922 from jdavcs/dev_model_edits1
Model edits and bug fixes
2024-04-11 20:30:25 -04:00
mvdbeek 9ff846aba6 Merge branch 'release_24.0' into dev 2024-04-06 16:50:48 +02:00
John Davis 09fee6aaad Remove future, autocommit args from session and engine creation 2024-04-05 13:54:39 -04:00
Nicola Soranzo ad6fbe5b82 Merge branch 'release_23.2' into release_24.0 2024-04-05 14:52:29 +01:00
mvdbeek bd846d9b2e Adjust update_cwl_conformance_tests.sh for removed branch 2024-04-05 13:49:31 +02:00
John Davis 0e61d61f47 Fix SA2.0 error: joinedload does not take str args 2024-04-02 10:08:53 -04:00
Nicola Soranzo a2018a5e60 Enable flake8-comprehensions ruff rules
but allow `dict()` calls that make use of keyword arguments (e.g.,
`dict(a=1, b=2)`).
2024-03-09 19:11:20 +00:00
mvdbeek f20c499154 Maybe change the initial 1.dev0 version to 0.dev0 ? 2024-02-13 17:06:21 +01:00
Nicola Soranzo e975ca3754 Update to black 2024 stable style 2024-01-30 18:09:51 +00:00
John Davis e134e8b633 Merge branch 'release_23.2' into 'release_23.3' 2024-01-29 13:27:15 -05:00
Nate Coraor 90a0df5d48 Fix the purge historyless HDAs pgcleanup action 2024-01-29 11:25:30 -05:00
mvdbeek 1188f8bdda Drop unused code from dump_openapi_schema.py 2024-01-10 17:43:30 +01:00
mvdbeek 23ff26bbc8 TEMP: schema dumpt fix 2024-01-08 11:33:29 +01:00
Nate Coraor a973e0518b Accept any number of arguments to the secret decoder ring 2023-12-14 13:07:37 -05:00
John Davis 475f7227c4 Add future=True flag to SA engine 2023-12-12 09:54:08 -05:00
Nicola Soranzo 9339fb3a2f Fix B018 errors reported by flake8-bugbear 23.12.2 2023-12-11 21:00:54 +00:00
John Davis fc0a266bdb Merge pull request #16932 from jdavcs/dev_sa20_fix21
SQLAlchemy 2.0 upgrades (part 5)
2023-11-29 09:55:24 -05:00
John Davis fa5adb0f52 SA2.0: Do not bind MetaData: must use engine explicitly 2023-11-27 18:30:16 -05:00
Michael R. Crusoe df807e6d17 Use the walrus := operator!
Fixed by running:

```
ack --type=python -f | grep -v '^lib/galaxy/schema/bco/\|^lib/galaxy/schema/drs/\|^tools/\|^.venv/\|^.tox/' | grep -v '^lib/galaxy/files/sources/\|^lib/galaxy/job_metrics/\|^lib/galaxy/objectstore/\|^lib/galaxy/tool_util/\|^lib/galaxy/util/' | xargs auto-walrus
make format
```

Note that the directories for the packages listed in
`packages/packages_for_pulsar_by_dep_dag.txt`
were explictly excluded.
2023-11-26 18:34:10 +00:00
Michael R. Crusoe c00967cca4 Python 3.8 as new minimum version
Fixes: https://github.com/galaxyproject/galaxy/issues/16394

Also upgrade code to Python 3.8 syntax with:

```
ack --type=python -f | grep -v '^lib/galaxy/schema/bco/\|^lib/galaxy/schema/drs/\|lib/tool_shed_client/schema/trs.*.py\|^tools/\|^.venv/\|^.tox/' | grep -v '^lib/galaxy/files/sources/\|^lib/galaxy/job_metrics/\|^lib/galaxy/objectstore/\|^lib/galaxy/tool_util/\|^lib/galaxy/util/' | xargs pyupgrade --py38-plus
```
2023-11-26 18:34:09 +00:00
John Davis f91693dc6e Merge pull request #16783 from SergeyYakubov/get-rid-of-filename-property
Replace file_name property with get_file_name function
2023-11-08 17:19:40 -05:00
Yakubov, Sergey c30a4c06c2 Replace file_name property with get_file_name function 2023-11-08 17:17:14 -05:00
John Chilton d3d812c57b Merge pull request #16340 from jmchilton/per_object_store_admin
Augment pgcleanup to allow periodically deleting old datasets.
2023-11-02 13:03:52 -04:00
Nicola Soranzo 45fb60c530 Ignore UP036 ruff check in check_python.py 2023-10-28 17:35:12 +01:00
John Chilton ec6d8fd03b Fixes... 2023-09-27 14:30:42 -04:00
John Chilton 7dc0b1378b WIP: modern tool shed frontend 2023-09-27 14:30:42 -04:00
John Chilton 24b3abeb3e Script for bootstrapping the tool shed. 2023-09-26 13:46:59 -04:00
John Chilton d1d629074b ToolShed API 2.0 2023-09-26 13:46:58 -04:00
John Chilton 360b327de6 Augment pgcleanup to allow periodically deleting old datasets.
... and restricting operations to specific object store ids.
2023-09-25 15:10:13 -04:00
John Chilton da8ce00d88 Cleanup docs in admin_cleanup_datasets.py. 2023-09-25 14:49:45 -04:00
Nicola Soranzo d258e5791e Fix new E721 errors from ruff 0.0.290 2023-09-20 01:43:40 +01:00
Michael R. Crusoe 201bc19575 cwl conformance tests: use id field, not label 2023-09-07 13:14:03 +02:00