Draft
Conversation
agoscinski
commented
Nov 26, 2025
agoscinski
commented
Nov 26, 2025
agoscinski
commented
Nov 26, 2025
|
|
||
| # Check if profile already exists | ||
| # TODO think about when psql database exist but aiida profile was not successfully created | ||
| teardown_dbuser_from_aiida_profile(profile_name, pg_host, pg_port, pg_user, pg_password) |
Contributor
Author
There was a problem hiding this comment.
dont forget this to hnandle differentl
abb9659 to
b33fead
Compare
b33fead to
80b37d8
Compare
Introduces profile creation in utils/profile.py to store
information about the Airflow configuration in the AiiDA profile.
In addition scripts have been created that expose the profile management
functions in form of a CLI that will be later merged into the AiiDA CLI.
Only PostgreSQL is for now supported.
The test profile is created using these utilities to allow easier
debugging by having direct access to the test profile.
Key features:
- Profile creation with integrated Airflow database setup
- Automatic extraction of Airflow environment from profile configuration
- Profile verification to ensure Airflow support
- Proper teardown of both AiiDA and Airflow databases/users
Implementation details:
1. Profile Management (utils/profile.py):
- create_aiida_profile(): Creates AiiDA profile with Airflow support
- delete_aiida_profile(): Removes profile and cleans up databases/users
- setup_dbuser_from_aiida_profile(): Creates separate AiiDA and Airflow databases
- teardown_dbuser_from_aiida_profile(): Drops databases and users using admin credentials
- verify_profile_supports_airflow(): Validates required Airflow configuration keys
- from_profile_create_airflow_env(): Extracts Airflow environment variables from profile
- Uses admin credentials (pg_admin_*) to properly handle PostgreSQL operations
- Configure secrets for communication between scheduler, api-server and triggerer
2. CLI Scripts:
- scripts/cmd_profile_create.py: Creates new AiiDA profiles with Airflow support
- scripts/cmd_profile_delete.py: Deletes profiles with verification and cleanup
- scripts/cmd_airflow.py: Executes Airflow CLI commands with profile environment
(uses direct argument pass-through to support Airflow flags like -B)
Technical notes:
- Separate for AiiDA and Airflow, potentially same
- Admin credentials required for database/user deletion (PostgreSQL restriction)
- Profile verification ensures Airflow configuration is present before operations
- AIRFLOW_HOME stored in profile's config directory: <aiida_config>/<profile>/airflow
80b37d8 to
8942564
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support for Airflow in AiiDA profile
Introduces profile creation in utils/profile.py to store
information about the Airflow configuration in the AiiDA profile.
In addition scripts have been created that expose the profile management
functions in form of a CLI that will be later merged into the AiiDA CLI.
Only PostgreSQL is for now supported.
The test profile is created using these utilities to allow easier
debugging by having direct access to the test profile.
Key features:
Implementation details:
Profile Management (utils/profile.py):
CLI Scripts:
(uses direct argument pass-through to support Airflow flags like -B)
Technical notes: