fractal-server 2.4.1__py3-none-any.whl → 2.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- __VERSION__ = "2.4.1"
1
+ __VERSION__ = "2.4.2"
@@ -88,12 +88,11 @@ def set_db():
88
88
  alembic.config.main(argv=alembic_args)
89
89
  print("END: alembic.config")
90
90
  # Insert default group
91
- print("START: Default group creation")
91
+ print()
92
92
  _create_first_group()
93
- print("END: Default group creation")
93
+ print()
94
94
  # NOTE: It will be fixed with #1739
95
95
  settings = Inject(get_settings)
96
- print("START: First user creation")
97
96
  asyncio.run(
98
97
  _create_first_user(
99
98
  email=settings.FRACTAL_DEFAULT_ADMIN_EMAIL,
@@ -103,7 +102,7 @@ def set_db():
103
102
  is_verified=True,
104
103
  )
105
104
  )
106
- print("END: First user creation")
105
+ print()
107
106
 
108
107
 
109
108
  def update_db_data():
@@ -49,7 +49,7 @@ def _run_command_as_user(
49
49
  """
50
50
  logger.debug(f'[_run_command_as_user] {user=}, cmd="{cmd}"')
51
51
  if user:
52
- new_cmd = f"sudo --non-interactive -u {user} {cmd}"
52
+ new_cmd = f"sudo --set-home --non-interactive -u {user} {cmd}"
53
53
  else:
54
54
  new_cmd = cmd
55
55
  res = subprocess.run( # nosec
@@ -1134,7 +1134,7 @@ class FractalSlurmExecutor(SlurmExecutor):
1134
1134
  f.write(sbatch_script)
1135
1135
 
1136
1136
  # Prepare submission command
1137
- pre_command = f"sudo --non-interactive -u {self.slurm_user}"
1137
+ pre_command = f"sudo --set-home --non-interactive -u {self.slurm_user}"
1138
1138
  submit_command = f"sbatch --parsable {job.slurm_script}"
1139
1139
  full_command = f"{pre_command} {submit_command}"
1140
1140
 
@@ -55,9 +55,9 @@ from fractal_server.app.models import OAuthAccount
55
55
  from fractal_server.app.models import UserGroup
56
56
  from fractal_server.app.models import UserOAuth
57
57
  from fractal_server.app.schemas.user import UserCreate
58
- from fractal_server.logger import get_logger
58
+ from fractal_server.logger import set_logger
59
59
 
60
- logger = get_logger(__name__)
60
+ logger = set_logger(__name__)
61
61
 
62
62
  FRACTAL_DEFAULT_GROUP_NAME = "All"
63
63
 
@@ -264,9 +264,10 @@ async def _create_first_user(
264
264
  is_verified: `True` if the new user is verifie
265
265
  username:
266
266
  """
267
+ function_logger = set_logger("fractal_server.create_first_user")
268
+ function_logger.info(f"START _create_first_user, with email '{email}'")
267
269
  try:
268
270
  async with get_async_session_context() as session:
269
-
270
271
  if is_superuser is True:
271
272
  # If a superuser already exists, exit
272
273
  stm = select(UserOAuth).where( # noqa
@@ -275,9 +276,9 @@ async def _create_first_user(
275
276
  res = await session.execute(stm)
276
277
  existing_superuser = res.scalars().first()
277
278
  if existing_superuser is not None:
278
- logger.info(
279
- f"{existing_superuser.email} superuser already exists,"
280
- f" skip creation of {email}"
279
+ function_logger.info(
280
+ f"'{existing_superuser.email}' superuser already "
281
+ f"exists, skip creation of '{email}'"
281
282
  )
282
283
  return None
283
284
 
@@ -292,15 +293,19 @@ async def _create_first_user(
292
293
  if username is not None:
293
294
  kwargs["username"] = username
294
295
  user = await user_manager.create(UserCreate(**kwargs))
295
- logger.info(f"User {user.email} created")
296
+ function_logger.info(f"User '{user.email}' created")
296
297
 
297
298
  except UserAlreadyExists:
298
- logger.warning(f"User {email} already exists")
299
+ function_logger.warning(f"User '{email}' already exists")
300
+ finally:
301
+ function_logger.info(f"END _create_first_user, with email '{email}'")
299
302
 
300
303
 
301
304
  def _create_first_group():
302
- logger.info(
303
- f"START _create_first_group, with name {FRACTAL_DEFAULT_GROUP_NAME}"
305
+ function_logger = set_logger("fractal_server.create_first_group")
306
+
307
+ function_logger.info(
308
+ f"START _create_first_group, with name '{FRACTAL_DEFAULT_GROUP_NAME}'"
304
309
  )
305
310
  with next(get_sync_db()) as db:
306
311
  group_all = db.execute(select(UserGroup))
@@ -308,11 +313,13 @@ def _create_first_group():
308
313
  first_group = UserGroup(name=FRACTAL_DEFAULT_GROUP_NAME)
309
314
  db.add(first_group)
310
315
  db.commit()
311
- logger.info(f"Created group {FRACTAL_DEFAULT_GROUP_NAME}")
316
+ function_logger.info(
317
+ f"Created group '{FRACTAL_DEFAULT_GROUP_NAME}'"
318
+ )
312
319
  else:
313
- logger.info(
314
- f"Group {FRACTAL_DEFAULT_GROUP_NAME} already exists, skip."
320
+ function_logger.info(
321
+ f"Group '{FRACTAL_DEFAULT_GROUP_NAME}' already exists, skip."
315
322
  )
316
- logger.info(
317
- f"END _create_first_group, with name {FRACTAL_DEFAULT_GROUP_NAME}"
323
+ function_logger.info(
324
+ f"END _create_first_group, with name '{FRACTAL_DEFAULT_GROUP_NAME}'"
318
325
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fractal-server
3
- Version: 2.4.1
3
+ Version: 2.4.2
4
4
  Summary: Server component of the Fractal analytics platform
5
5
  Home-page: https://github.com/fractal-analytics-platform/fractal-server
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
- fractal_server/__init__.py,sha256=fzbY4OwDzXGBWKHXd6pSTnBjJSHcb2YKUZikrufgkI4,22
2
- fractal_server/__main__.py,sha256=I9hF_SYc-GTZWDZZhihwyUBK7BMU5GAecbPLTjkpW4U,5830
1
+ fractal_server/__init__.py,sha256=ahWw3pwB7t1_-BJaAAlCiD70Oi6bdhi1gUXGpXaDLzM,22
2
+ fractal_server/__main__.py,sha256=upYBkGYrkBnkS1rp4D_nb_1LS37QT4j-wxGX1ZMvR4A,5704
3
3
  fractal_server/alembic.ini,sha256=MWwi7GzjzawI9cCAK1LW7NxIBQDUqD12-ptJoq5JpP0,3153
4
4
  fractal_server/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  fractal_server/app/db/__init__.py,sha256=KpS_mfmRfew0kieFDlwkSrDFvpzxftcvPALBBZ0LxsY,4048
@@ -81,8 +81,8 @@ fractal_server/app/runner/executors/slurm/ssh/executor.py,sha256=oCc5cLZoNmJ3ENV
81
81
  fractal_server/app/runner/executors/slurm/sudo/__init__.py,sha256=Cjn1rYvljddi96tAwS-qqGkNfOcfPzjChdaEZEObCcM,65
82
82
  fractal_server/app/runner/executors/slurm/sudo/_check_jobs_status.py,sha256=wAgwpVcr6JIslKHOuS0FhRa_6T1KCManyRJqA-fifzw,1909
83
83
  fractal_server/app/runner/executors/slurm/sudo/_executor_wait_thread.py,sha256=z5LlhaiqAb8pHsF1WwdzXN39C5anQmwjo1rSQgtRAYE,4422
84
- fractal_server/app/runner/executors/slurm/sudo/_subprocess_run_as_user.py,sha256=uZgmxP0ZneGpzTVt-GT-6EgNKUh1sW2-QH7LFYc1tNI,5132
85
- fractal_server/app/runner/executors/slurm/sudo/executor.py,sha256=74jfNauDgQOdcILHcCLJM4Awm_SThsZYgc0Vwx0hnB8,48460
84
+ fractal_server/app/runner/executors/slurm/sudo/_subprocess_run_as_user.py,sha256=0wRA-hg0JxVrFw4rBXAu6P2L2dbwzx2N_kUmpil1ErU,5143
85
+ fractal_server/app/runner/executors/slurm/sudo/executor.py,sha256=6D83o4BE5D-1LZ3BhfEmhWJ1DZrk3Vzg-b3tB5TWMAU,48471
86
86
  fractal_server/app/runner/extract_archive.py,sha256=tLpjDrX47OjTNhhoWvm6iNukg8KoieWyTb7ZfvE9eWU,2483
87
87
  fractal_server/app/runner/filenames.py,sha256=9lwu3yB4C67yiijYw8XIKaLFn3mJUt6_TCyVFM_aZUQ,206
88
88
  fractal_server/app/runner/run_subprocess.py,sha256=KTkJnWLrLQdR2WRJ3jGu0RBu4330L3mtCAE_B0wDx3M,818
@@ -149,7 +149,7 @@ fractal_server/app/schemas/v2/task.py,sha256=7IfxiZkaVqlARy7WYE_H8m7j_IEcuQaZORU
149
149
  fractal_server/app/schemas/v2/task_collection.py,sha256=8PG1bOqkfQqORMN0brWf6mHDmijt0bBW-mZsF7cSxUs,6129
150
150
  fractal_server/app/schemas/v2/workflow.py,sha256=Zzx3e-qgkH8le0FUmAx9UrV5PWd7bj14PPXUh_zgZXM,1827
151
151
  fractal_server/app/schemas/v2/workflowtask.py,sha256=atVuVN4aXsVEOmSd-vyg-8_8OnPmqx-gT75rXcn_AlQ,6552
152
- fractal_server/app/security/__init__.py,sha256=FBxdrMvn2s3Gdmp1orqOpYji87JojLBzr9TMfblj1SI,11441
152
+ fractal_server/app/security/__init__.py,sha256=vuAE0sg2er0I2PAf7xCUHcxbMgxV1d8y6oJjO98n86o,11858
153
153
  fractal_server/config.py,sha256=R0VezSe2PEDjQjHEX2V29A1jMdoomdyECBjWNY15v_0,25049
154
154
  fractal_server/data_migrations/2_4_0.py,sha256=T1HRRWp9ZuXeVfBY6NRGxQ8aNIHVSftOMnB-CMrfvi8,2117
155
155
  fractal_server/data_migrations/README.md,sha256=_3AEFvDg9YkybDqCLlFPdDmGJvr6Tw7HRI14aZ3LOIw,398
@@ -207,8 +207,8 @@ fractal_server/tasks/v2/utils.py,sha256=JOyCacb6MNvrwfLNTyLwcz8y79J29YuJeJ2MK5kq
207
207
  fractal_server/urls.py,sha256=5o_qq7PzKKbwq12NHSQZDmDitn5RAOeQ4xufu-2v9Zk,448
208
208
  fractal_server/utils.py,sha256=b7WwFdcFZ8unyT65mloFToYuEDXpQoHRcmRNqrhd_dQ,2115
209
209
  fractal_server/zip_tools.py,sha256=xYpzBshysD2nmxkD5WLYqMzPYUcCRM3kYy-7n9bJL-U,4426
210
- fractal_server-2.4.1.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
211
- fractal_server-2.4.1.dist-info/METADATA,sha256=JCCF3ijNeP2qZzZhZKYcsSdskyLfo4jXVIT1ebF65bY,4628
212
- fractal_server-2.4.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
213
- fractal_server-2.4.1.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
214
- fractal_server-2.4.1.dist-info/RECORD,,
210
+ fractal_server-2.4.2.dist-info/LICENSE,sha256=QKAharUuhxL58kSoLizKJeZE3mTCBnX6ucmz8W0lxlk,1576
211
+ fractal_server-2.4.2.dist-info/METADATA,sha256=rhvEtARu8BKU2hg2lsbhXA7NLqDXTtvWEenYBpXExmg,4628
212
+ fractal_server-2.4.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
213
+ fractal_server-2.4.2.dist-info/entry_points.txt,sha256=8tV2kynvFkjnhbtDnxAqImL6HMVKsopgGfew0DOp5UY,58
214
+ fractal_server-2.4.2.dist-info/RECORD,,