-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 147 postgres integration #297
Open
AcquaDiGiorgio
wants to merge
14
commits into
DIRACGrid:main
Choose a base branch
from
AcquaDiGiorgio:issue-147-postgres-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96fbf70
feat: Add PostgreSQL integration to diracx-db
AcquaDiGiorgio ef817ae
feat: remove mysql specific code
AcquaDiGiorgio 12221ab
Merge branch 'DIRACGrid:main' into issue-147-postgres-integration
AcquaDiGiorgio a148ac2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 606f290
feat: Modify integration tests to execute against both MySQL and Post…
AcquaDiGiorgio a9bcf7a
feat: add postgres to the debbuging information of the integration tests
AcquaDiGiorgio 792a1b9
Merge branch 'main' into issue-147-postgres-integration
AcquaDiGiorgio 46ce608
fix: Change JobDB schema to make datetime columns properly accept a t…
AcquaDiGiorgio 6b7618f
Merge branch 'main' into issue-147-postgres-integration
AcquaDiGiorgio 33048d7
chore: Rename integration tests to fit the DB being used
AcquaDiGiorgio 17db91d
Merge branch 'main' into issue-147-postgres-integration
AcquaDiGiorgio 965a74c
fix: Restore EnumBackedBool enum class name lost at merge
AcquaDiGiorgio 1194baf
Merge branch 'main' into issue-147-postgres-integration
AcquaDiGiorgio a1b4007
fix: Remove EnumBackedBool redefinition
AcquaDiGiorgio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,16 @@ jobs: | |
uses: codecov/[email protected] | ||
|
||
pytest-integration: | ||
name: Integration test - ${{ matrix.dbName }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dbName: "MySQL" | ||
cliOption: "" | ||
- dbName: "PostgreSQL" | ||
cliOption: "--postgres" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
@@ -96,15 +105,15 @@ jobs: | |
pip install ./diracx-core/[testing] ./diracx-api/[testing] ./diracx-cli/[testing] ./diracx-client/[testing] ./diracx-routers/[testing] ./diracx-db/[testing] ./diracx-testing/ | ||
- name: Start demo | ||
run: | | ||
git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts | ||
../diracx-charts/run_demo.sh --enable-open-telemetry --enable-coverage --exit-when-done --set-value developer.autoReload=false --ci-values ../diracx-charts/demo/ci_values.yaml $PWD | ||
git clone -b diracx-issue-147-postgres-integration https://github.com/AcquaDiGiorgio/diracx-charts.git ../diracx-charts | ||
../diracx-charts/run_demo.sh ${{ matrix.cliOption }} --enable-open-telemetry --enable-coverage --exit-when-done --set-value developer.autoReload=false --ci-values ../diracx-charts/demo/ci_values.yaml $PWD | ||
- name: Debugging information | ||
run: | | ||
DIRACX_DEMO_DIR=$PWD/../diracx-charts/.demo | ||
export KUBECONFIG=${DIRACX_DEMO_DIR}/kube.conf | ||
export PATH=${DIRACX_DEMO_DIR}:$PATH | ||
kubectl get pods | ||
for pod_name in $(kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do | ||
for pod_name in $(kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|postgres|rabbitmq|opensearch)'); do | ||
echo "${pod_name}" | ||
kubectl describe pod/"${pod_name}" || true | ||
for container_name in $(kubectl get pods $pod_name -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}'); do | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We are anyway always using UTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is because we are specifying the timezone in
datetime.now(tz=timezone.utc)
.While this does not throw any errors in MySQL when the table does not accept a timezone, in PostgreSQL stops the execution due to conflicting formatting.
One way of fixing it is just to completely remove the timezone on the
datetime.now
function, which is not recommended and even RUFF marks it as a warning.The other way is by telling the column to take into account the timezone, which in my opinion is the better way of implementing it.
MySQL:
tz=timezone.utc
: 2024-09-26 14:05:53PostgreSQL:
tz=timezone.utc
: 2024-09-26 13:55:57.840623