Skip to content
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

Build docker #10

Merged
merged 303 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
303 commits
Select commit Hold shift + click to select a range
d746e2e
Update schemas comments following google docstyle
giosava94 Nov 30, 2023
5e05979
Add tests on check_write_access func
giosava94 Dec 4, 2023
029144a
Replace check_read_access with inject_user_infos
giosava94 Dec 5, 2023
0ba881f
Merge branch 'doc' into auth
giosava94 Dec 5, 2023
456f41c
Updating documentation
giosava94 Dec 5, 2023
19a87a1
lazy_security no more needed
giosava94 Dec 5, 2023
1def447
Merge branch 'auth' into doc
giosava94 Dec 5, 2023
360c95a
Updating comments in generic modules
giosava94 Dec 5, 2023
35e244d
Update Security
giosava94 Dec 5, 2023
f3ab64a
Use absolute paths in models.py
giosava94 Dec 5, 2023
9cdc56f
Fixing comments
giosava94 Dec 5, 2023
c5add6e
Documenting schemas_extended
giosava94 Dec 6, 2023
31d3f9d
Add attributes to schemas_extended
giosava94 Dec 6, 2023
42ced89
Fix public schemas, remove short ones
giosava94 Dec 6, 2023
6034f4b
Update docs in public schemas extended
giosava94 Dec 6, 2023
ca70b68
Update cruds to not use short schemas
giosava94 Dec 6, 2023
58d810e
Remove from endpoints short schemas
giosava94 Dec 6, 2023
bf0e308
Remove short attribute from crud calls
giosava94 Dec 6, 2023
006b79c
Commenting query.py and removing short attribute
giosava94 Dec 6, 2023
337fdd7
Commenting config.py
giosava94 Dec 6, 2023
50f9853
Using constants for pydantic attr desc
giosava94 Dec 7, 2023
00748ee
Merge branch 'schemas' into tests-refactoring
giosava94 Dec 7, 2023
dabedec
Update ruff exceptions
giosava94 Dec 7, 2023
0ad7770
Remove short schemas from tests
giosava94 Dec 7, 2023
67f7089
Merge branch 'schemas' into tests-refactoring
giosava94 Dec 7, 2023
f78a66b
Delete last region fails with 409 instead 50x
giosava94 Dec 7, 2023
02369be
Renamed crud instances
giosava94 Dec 7, 2023
90f6839
Fix ruff config
giosava94 Dec 7, 2023
3939369
Delete unused subquery model
giosava94 Dec 7, 2023
301a493
Commenting code
giosava94 Dec 7, 2023
bb0dd39
Using pytest-cases
giosava94 Dec 7, 2023
f9b41b3
Updating test creation schema for Flavor
giosava94 Dec 11, 2023
0ee1b6f
Add basic read schema tests for Flavor
giosava94 Dec 11, 2023
58007c5
Update schema read tests
giosava94 Dec 11, 2023
1de6c96
Revert "Remove short attribute from crud calls"
giosava94 Dec 11, 2023
15aef38
Fix typo in flavor fixture decorator
giosava94 Dec 12, 2023
1f510b1
Fix create operation: Re-add .save()
giosava94 Dec 12, 2023
1b2a51b
Add patch tests on schemas (Flavor)
giosava94 Dec 12, 2023
89a7e4f
Split cases from validation functions
giosava94 Dec 12, 2023
94aa1d7
Fix ref in fixtures cascade
giosava94 Dec 12, 2023
eb930cd
Refactoring flavor test cases classes
giosava94 Dec 12, 2023
4f2501e
Moving parametrize in fixture.
giosava94 Dec 12, 2023
031acac
Merging test classes
giosava94 Dec 12, 2023
1e47e45
cases_schema does not depends on flavor. Moved files
giosava94 Dec 13, 2023
7e22a7e
Remove schema derived classes to avoid duplicate code
giosava94 Dec 13, 2023
83914f1
Update conftest.py to include fixtures of different folders
giosava94 Dec 13, 2023
92fce65
Tuple for schema cases are fixtures
giosava94 Dec 13, 2023
578a471
Fix validate_attrs to correctly check for lists
giosava94 Dec 13, 2023
6325e26
Add image fixtures to test schemas with cases
giosava94 Dec 13, 2023
f51ee52
Update location public schema
giosava94 Dec 13, 2023
b392cac
Add location fixtures
giosava94 Dec 13, 2023
66b68c2
Fix db_shared fixtures with correct attributes
giosava94 Dec 13, 2023
ce3bea4
Add annotations to func def
giosava94 Dec 13, 2023
a425044
Fix schema validation for One or ZeroOrOne relationships
giosava94 Dec 13, 2023
7b2a5ee
Reordering desc attribute in fixtures
giosava94 Dec 13, 2023
9888c9d
Add network fixtures
giosava94 Dec 13, 2023
55d5295
Add workflow to build and push docker image
giosava94 Dec 13, 2023
b776c4e
Update README.md with deployment instructions
giosava94 Dec 13, 2023
9051250
Fix db_simple dependencies
giosava94 Dec 13, 2023
d00e290
Split read_attrs and add exclude_attrs param
giosava94 Dec 13, 2023
c6821d8
Fix enum validation
giosava94 Dec 13, 2023
f377e76
Using flaat v1.1.15
giosava94 Dec 13, 2023
adab3f0
Add project and provider fixtures.
giosava94 Dec 13, 2023
cf51309
Renaming create data fixtures
giosava94 Dec 14, 2023
79a3dae
Add provider fixtures with relationships and duplicate items
giosava94 Dec 14, 2023
bd2c086
Add valid create fixtures for all items
giosava94 Dec 14, 2023
ac55447
Add 'invalid' create fixtures for all items
giosava94 Dec 14, 2023
30389bc
Skip nested create item validation. Convert to ISO dates when validat…
giosava94 Dec 14, 2023
1dbbe53
Update patch tests on schemas
giosava94 Dec 14, 2023
16c4be4
Update DB instances for provider, region and services
giosava94 Dec 14, 2023
bc71f43
Add flavor, image and location DB fixtures
giosava94 Dec 14, 2023
b13f168
Add network DB fixtures
giosava94 Dec 14, 2023
c91f2e8
Merge branch 'tests-refactoring' into build-docker
giosava94 Dec 15, 2023
5b7d85d
Re-introduce build-docker branch in build-docker.yaml
giosava94 Dec 15, 2023
f321ee8
Update DB fixtures for quotas
giosava94 Dec 15, 2023
a086e93
Add identity_provider tests. Add check for db_shared fixtures.
giosava94 Dec 15, 2023
865eff0
Update README.md with the minimum requirements to start up the app
giosava94 Dec 15, 2023
4a9638b
Update user group and identity provider DB fixtures
giosava94 Dec 15, 2023
ec50a5a
Splitting fixtures in multiple smaller files
giosava94 Dec 15, 2023
dc1907d
Dedicated fixture for provider with single project
giosava94 Dec 16, 2023
92ccb0f
Split fixtures for network
giosava94 Dec 16, 2023
caa1ead
Split region cases with single and multiple compute services
giosava94 Dec 16, 2023
24bae92
Split image fixtures and update flavor db ones
giosava94 Dec 16, 2023
4936ed4
Fix shared db fixtures
giosava94 Dec 16, 2023
9633761
Moved utils in tests
giosava94 Dec 16, 2023
789fa09
Delete schemas folder in tests
giosava94 Dec 16, 2023
a586f0e
Delete db fixtures in generic fixtures folder
giosava94 Dec 16, 2023
2470962
Update fixtures in idp, user group, slas and projects (missing db ones)
giosava94 Dec 16, 2023
116c905
Updating parameter in @parametrize
giosava94 Dec 16, 2023
7d61f0c
Update fixture db of sla, user groups, idps and projects
giosava94 Dec 17, 2023
1b630f3
Remove fixtures folder
giosava94 Dec 17, 2023
980fa3f
Add DOMAIN variable to parametrize automatic doc
giosava94 Dec 17, 2023
0a9d09e
Updating dependencies
giosava94 Dec 17, 2023
cf50cfb
Remove TRUSTED_IPD_LIST from .devcontainer
giosava94 Dec 17, 2023
fb11d9a
Non-fixture func with dict with item attributes
giosava94 Dec 17, 2023
beb52c0
Add non-fixture func to create mandatory relationships
giosava94 Dec 17, 2023
36d5271
Do not use Create schemas in create_dict tests
giosava94 Dec 17, 2023
4012f94
Db fixtures completely decoupled from create_dict fixtures
giosava94 Dec 17, 2023
b58ad79
Fix test for DB shared location
giosava94 Dec 17, 2023
d357180
Updating DB fixtures for SLA, IDP and UserGroups
giosava94 Dec 17, 2023
1f0c130
Update missing DB fixtures
giosava94 Dec 18, 2023
4c1ffe6
Fix image and flavor crud operation
giosava94 Dec 18, 2023
641cd8a
Updating validation schemas structure
giosava94 Dec 18, 2023
4bd577d
Move common schema files into dedicated folder
giosava94 Dec 18, 2023
1547f4a
Add new tests for basic CRUD operations for provider
giosava94 Dec 18, 2023
2195752
from_provider param does not exist anymore
giosava94 Dec 18, 2023
0134388
Check integers values in common query classes
giosava94 Dec 18, 2023
f19a98c
Merge class and tuple fixtures to reduce total number
giosava94 Dec 18, 2023
6d58cbb
Single file for CRUD specific fixtures
giosava94 Dec 18, 2023
40e6a9e
Updating fixture names
giosava94 Dec 18, 2023
7a6ecd2
Add simple patch validation tests
giosava94 Dec 18, 2023
5c9b105
Update delete crud tests
giosava94 Dec 19, 2023
1d15085
Fix patch crud fixtures
giosava94 Dec 19, 2023
aadea55
Update merging fixtures to use fixture_union
giosava94 Dec 19, 2023
d3ddf32
Add test with patch applying no changes
giosava94 Dec 19, 2023
630dd47
Add patch with default (valid and invalid)
giosava94 Dec 19, 2023
b512259
Add tests on forced update (missing final validation)
giosava94 Dec 19, 2023
2c031ce
Update crud cases and fixtures
giosava94 Dec 20, 2023
ef60b20
Changed schemas fixtures to cases
giosava94 Dec 20, 2023
694cb70
Remove fixtures crud
giosava94 Dec 20, 2023
682cfce
Mandatory usage of a neo4j instance in README.md
giosava94 Dec 20, 2023
b852e1f
Add Region crud tests
giosava94 Dec 20, 2023
bb9ea8e
Can't use db_provider fixtures in region crud cases
giosava94 Dec 20, 2023
ba620d4
Autouse fixture to setup and teardown db
giosava94 Dec 21, 2023
fe0951e
Region cases can use db_provider fixtures
giosava94 Dec 21, 2023
a6afd52
Common function to detect public and extended from read class
giosava94 Dec 21, 2023
072474e
Add functions to generate data not equal to the current DB instance
giosava94 Dec 21, 2023
3761ad0
Fix sort algorithm when equalities
giosava94 Dec 21, 2023
883516f
Use no_defaults DB instance when using get_multi
giosava94 Dec 21, 2023
941983a
Add location crud tests. Fix sort tests
giosava94 Dec 21, 2023
4d629c1
Merge branch 'tests-refactoring' into build-docker
giosava94 Dec 21, 2023
587376f
Fix validation on location country
giosava94 Dec 21, 2023
cfc5538
Merge branch 'tests-refactoring' into build-docker
giosava94 Dec 21, 2023
8a1bd57
Merge remote-tracking branch 'origin/main' into tests-refactoring
giosava94 Jan 8, 2024
d31f1b4
Merge branch 'tests-refactoring' into build-docker
giosava94 Jan 8, 2024
5356a6f
Test settings
giosava94 Jan 8, 2024
c29bc8b
Update Readme
giosava94 Jan 9, 2024
cb4bc51
Move start and end dates' order check in SLA base class
giosava94 Jan 9, 2024
1cb1eca
Merge branch 'tests-refactoring' into build-docker
giosava94 Jan 9, 2024
7b70ddf
Fix requirements import in production layer of dockerfile
giosava94 Jan 9, 2024
6906685
Wrap variables in brackets (sonarcloud warning)
giosava94 Jan 9, 2024
b2b36a3
Track launch.json in .vscode folder
giosava94 Jan 9, 2024
08475e0
Add comments to app __init__.py files
giosava94 Jan 9, 2024
9ab2ae4
Add comments to endpoints and dependencies top lines
giosava94 Jan 9, 2024
e634c0d
Update comments on dependencies
giosava94 Jan 9, 2024
38895c0
Add comments to endpoints functions
giosava94 Jan 9, 2024
6479ac4
Add comments to utils
giosava94 Jan 9, 2024
e3303d5
Protect provider POST operation
giosava94 Jan 9, 2024
2a39465
Fix lock in docs page on write operations
giosava94 Jan 9, 2024
f76b05d
Fix read operation security
giosava94 Jan 9, 2024
a32a376
Updating sonar CI to run on multiple python version.
giosava94 Jan 9, 2024
2bc90c4
Limiting tests to only one file to check correctness of yaml
giosava94 Jan 9, 2024
b223587
Edit test_auth to work without client.py
giosava94 Jan 9, 2024
d9a0ec4
Do not load all tests
giosava94 Jan 9, 2024
8e10944
Remove nox
giosava94 Jan 10, 2024
2fe2b21
Merge branch 'build-docker' into dev
giosava94 Jan 10, 2024
af43d02
Update db transaction decorator position
giosava94 Jan 10, 2024
bf7ec07
Add again comments at the top of endpoints.py files
giosava94 Jan 10, 2024
a1a54c6
Single validator for NEOMODEL_DATABASE_URL
giosava94 Jan 11, 2024
74c752f
Merge branch 'build-docker' into neomodel
giosava94 Jan 11, 2024
4eb1dbb
Update neomodel to v5.2.1. Use personal repository to fix transaction…
giosava94 Jan 12, 2024
87baa71
Update core validators to fix from_orm error
giosava94 Jan 12, 2024
8b9ff58
Fix doc string in provider schemas
giosava94 Jan 12, 2024
649e169
Add classmethod decorator to all validators
giosava94 Jan 12, 2024
5198de7
Update signature of delete operation
giosava94 Jan 12, 2024
33e9e15
Update launch.json
giosava94 Jan 12, 2024
24286be
Update poetry.lock
giosava94 Jan 12, 2024
a9bd52b
Update neo4j DB version from 5.8 to 5.15
giosava94 Jan 12, 2024
02dc3ed
Remove classmethod from pep8-naming classmethod-decorators
giosava94 Jan 12, 2024
d5ba2ee
Delete .env file
giosava94 Jan 12, 2024
b0bcf14
Add provider_status param to user_groups GET endpoint
giosava94 Jan 12, 2024
940b74f
Add maintainer info to env variables
giosava94 Jan 15, 2024
97904e8
Update DB_URL env var name
giosava94 Jan 15, 2024
4121168
Update README.md
giosava94 Jan 17, 2024
d1f5120
Fix error in provider dependencies
giosava94 Jan 17, 2024
5add7f8
Fix location country_code validator
giosava94 Jan 17, 2024
916b15d
Update service type check description
giosava94 Jan 17, 2024
cc6d2d3
Add provider put endpoint
giosava94 Jan 17, 2024
c5b9efd
Create separate dockerfile for devcontainer
giosava94 Jan 17, 2024
adf23cc
Update dockerfiles to install dev where needed
giosava94 Jan 17, 2024
ca22ccb
Remove unused args in compose
giosava94 Jan 17, 2024
6accf19
Fix API_V1_STR validation and usage
giosava94 Jan 18, 2024
fcac281
Update README.md
giosava94 Jan 18, 2024
808a8e0
Fix README typos
giosava94 Jan 18, 2024
2347fde
Change SLA root_validator with validator on end_date
giosava94 Jan 19, 2024
5523e9a
Convert UUID in lists to str is a core func
giosava94 Jan 19, 2024
c918677
Fix validators execution
giosava94 Jan 24, 2024
83597dc
Fix function inline hints
giosava94 Jan 26, 2024
fcb0e73
Update pyproject.toml and poetry.lock
giosava94 Jan 31, 2024
a22b92e
Use pytest v7
giosava94 Feb 4, 2024
b6cd55e
Update settings and related tests
giosava94 Feb 4, 2024
0640325
Comment BACKEND_CORS_ORIGINS logic
giosava94 Feb 4, 2024
3c65c90
Use slim images
giosava94 Feb 4, 2024
14f9039
Add tests on BaseNode and BaseNodeRead
giosava94 Feb 5, 2024
05436a9
Add tests on Query related Schemas
giosava94 Feb 6, 2024
820cfc8
Test query model creation
giosava94 Feb 6, 2024
aed79a0
Add basic tests on neomodel classes
giosava94 Feb 6, 2024
b92d1e0
Improve neomodel tests
giosava94 Feb 6, 2024
cd7c4bb
Add basic check on model relations
giosava94 Feb 6, 2024
1baa04e
Update poetry dependencies to use fastapi 0.109
giosava94 Feb 9, 2024
340dd34
Merge branch 'build-docker' into devel
giosava94 Feb 9, 2024
d049f87
Rename app folder in fed_reg
giosava94 Feb 14, 2024
c90629d
Update provider base public schema to have type
giosava94 Feb 14, 2024
b405f39
Updating model tests and removing everything else
giosava94 Feb 20, 2024
bffb0f4
Collect create_dict functions
giosava94 Feb 20, 2024
71222c7
Update tests on flavor projects
giosava94 Feb 21, 2024
448068d
Fixtures to mock db in all neomodel classes tests
giosava94 Feb 21, 2024
77328cb
Add IDP model rel tests
giosava94 Feb 21, 2024
dbd8f32
Add rel checks on all entities
giosava94 Feb 21, 2024
34a6eba
Add flavor non-read schemas tests
giosava94 Feb 21, 2024
9b97286
Add tests on identity provider non-read schemas
giosava94 Feb 21, 2024
4300d0a
Add image non-read schemas tests
giosava94 Feb 21, 2024
e294178
Add location non-read schema tests. Fix latitude and longitude max min
giosava94 Feb 22, 2024
b9af3f3
Add network non-read schemas tests
giosava94 Feb 22, 2024
27dcff6
Add project and provider non-read schema tests
giosava94 Feb 22, 2024
3714470
Add region and user group non-read schemas tests
giosava94 Feb 22, 2024
998b719
Add SLA non-read schemas tests
giosava94 Feb 22, 2024
5c5bc0c
Add quota non-read schemas tests
giosava94 Feb 22, 2024
a374ff8
Add services non-read schemas tests
giosava94 Feb 22, 2024
1388874
Add tests on create extended schemas
giosava94 Feb 27, 2024
1dafe33
Add tests on 'idp projects exist' validator
giosava94 Feb 28, 2024
bf7c988
Update tests to create extended schemas
giosava94 Feb 28, 2024
44b34fe
Add default value to ArrayProperties in neo4j models
giosava94 Feb 29, 2024
7edb978
Add tests on read schemas
giosava94 Feb 29, 2024
6f6be70
Add basic tests on Provider read extended classes
giosava94 Mar 5, 2024
64ecd7f
Test provider read extended subclasses
giosava94 Mar 5, 2024
79db9a9
Add tests to region read extended
giosava94 Mar 5, 2024
70f62cb
Update devcontainer
giosava94 Mar 19, 2024
bf31cdb
Dockerfile no more needed
giosava94 Mar 19, 2024
204b049
Update devcontainer settings and startup
giosava94 Mar 20, 2024
f4329de
Update dependencies
giosava94 Mar 20, 2024
db17ebf
Fix typo in devcontainer compose
giosava94 Mar 20, 2024
e31cd1d
Merge remote-tracking branch 'origin/devel' into devel
giosava94 Mar 20, 2024
068ff56
First version of mockDB (applied to flavor)
giosava94 Mar 22, 2024
51ceb04
Merge remote-tracking branch 'origin/devel' into devel
giosava94 Mar 22, 2024
4c1ae22
Auto use db fixtures
giosava94 Mar 22, 2024
05a5fff
Update mock db to match relationships with data
giosava94 Mar 22, 2024
2183b43
Fix all model tests to use fake DB
giosava94 Mar 22, 2024
1d3a5bd
Updating schema tests to use the fake DB
giosava94 Mar 22, 2024
9d13180
Improve tests on read extended schemas of provider and region
giosava94 Mar 25, 2024
8236219
Add tests to location read_ext
giosava94 Mar 25, 2024
c417d86
Update fake db logic
giosava94 Mar 26, 2024
8d1352a
Using python3.9 and networkx on tests to emulate neo4j
giosava94 Mar 26, 2024
59e3cb8
Updating types
giosava94 Mar 26, 2024
dd08dbf
Updating project for tests
giosava94 Apr 8, 2024
71175cf
ImageOS is case insensitive
giosava94 Apr 8, 2024
1067e62
Merge branch 'devel' into networkx
giosava94 Apr 8, 2024
45208f5
Fix ImageOS enum
giosava94 Apr 8, 2024
b6e6411
Rename proxy_ip to proxy_host
giosava94 Apr 8, 2024
1d8cb2c
Use python 3.9 in docker images
giosava94 Apr 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[run]
relative_files = True
source = app/
source = fed_reg/
branch = True
42 changes: 32 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,58 @@
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml",
"charliermarsh.ruff",
"ms-python.python",
"ms-python.vscode-pylance",
"yzhang.markdown-all-in-one",
"eamodio.gitlens",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode"
"SonarSource.sonarlint-vscode",
"eamodio.gitlens",
"charliermarsh.ruff"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python"
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"[dockercompose]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"sonarlint.connectedMode.project": {
"connectionId": "indigo-paas/federation-registry",
"projectKey": "indigo-paas_federation-registry"
},
"python.analysis.autoFormatStrings": true,
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.pytestParameters": true,
"python.analysis.autoImportCompletions": true,
"python.analysis.completeFunctionParens": true,
"python.defaultInterpreterPath": "/home/node/.venv/bin/python",
"python.testing.pytestEnabled": true
}
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/act:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/devcontainers-contrib/features/ruff:1": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "3.9"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
"postStartCommand": "bash .devcontainer/postCreateCommand.sh"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
Expand Down
45 changes: 28 additions & 17 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,47 @@ version: "3"

services:
db:
image: neo4j:5.8.0
image: neo4j:5.15
container_name: fed-reg-devc-db
volumes:
- dev-db-data:/data
- dev-db-logs:/logs
ports:
- "7474:7474"
- "7687:7687"
- fed-reg-devc-db-data:/data
- fed-reg-devc-db-logs:/logs
environment:
- NEO4J_AUTH=none
- NEO4J_PLUGINS=["apoc"]
networks:
- fed-reg-devc-db

oidc-agent:
image: opensciencegrid/oidc-agent:3.6-release-20230802-1615
image: opensciencegrid/oidc-agent:3.6-release-20240220-1639
container_name: fed-reg-devc-oidc-agent
platform: linux/amd64
volumes:
- fed-reg-devc-oidc-agent-iss-config:/root/.oidc-agent
networks:
- fed-reg-devc-oidc-agent

base:
build:
context: ../.
target: development
args:
INSTALL_DEV: ${INSTALL_DEV-true}
image: mcr.microsoft.com/devcontainers/typescript-node:18
container_name: fed-reg-devc-base
depends_on:
- db
- oidc-agent
volumes:
- ..:/workspace:cached
environment:
- NEO4J_SERVER=db
# Infinite loop to keep container live doing nothing
command: bash -c "while true; do sleep 1; done"
- NEO4J_SERVER=fed-reg-devc-db
- OIDC_AGENT_CONTAINER_NAME=fed-reg-devc-oidc-agent
networks:
- fed-reg-devc-db
- fed-reg-devc-oidc-agent
command: sleep infinity

volumes:
dev-db-data:
dev-db-logs:
fed-reg-devc-db-data:
fed-reg-devc-db-logs:
fed-reg-devc-oidc-agent-iss-config:

networks:
fed-reg-devc-db:
fed-reg-devc-oidc-agent:
5 changes: 5 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
poetry install

echo alias oidc-add=\'docker exec -it \${OIDC_AGENT_CONTAINER_NAME} oidc-add\' >> /home/node/.bashrc
echo alias oidc-gen=\'docker exec -it \${OIDC_AGENT_CONTAINER_NAME} oidc-gen\' >> /home/node/.bashrc
echo alias oidc-token=\'docker exec \${OIDC_AGENT_CONTAINER_NAME} oidc-token\' >> /home/node/.bashrc
42 changes: 0 additions & 42 deletions .env

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and push docker image to Docker Hub

on:
push:
branches: [main, build-docker]
tags:
- "v*"
pull_request:
branches: [main]

workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v5
with:
images: indigopaas/federation-registry
tags: |
type=sha
type=semver,pattern={{raw}}
type=ref,event=branch
- name: Build & Push image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
24 changes: 13 additions & 11 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- devel
- ci
pull_request:
types:
- opened
Expand All @@ -15,23 +16,22 @@ jobs:
test-analysis:
name: Python tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.8]
#, 3.9, 3.10, 3.11]

services:
neo4j-db:
# Set up neo4j DB with APOC extension for UUIDs.
neo4j:
image: neo4j:5.8.0
ports:
- 7474:7474
- 7687:7687
- 7687
env:
NEO4J_AUTH: none
NEO4J_PLUGINS: "apoc"

strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -44,6 +44,7 @@ jobs:
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

# Set up python versions to use
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -59,16 +60,17 @@ jobs:

# Run tests
- name: Run tests
run: poetry run pytest --cov --cov-report=xml --cov-report=html
run: poetry run pytest tests/test_auth.py --cov --cov-report=xml --cov-report=html
env:
NEO4J_SERVER: localhost:7687
NEO4J_SERVER: "localhost:${{ job.services.neo4j-db.ports[7687] }}"

# Upload coverage as artifacts
- name: Upload HTML coverage as artifact
uses: actions/upload-artifact@v3
with:
name: code-coverage-${{ matrix.python-version }}-html
path: htmlcov

- name: Upload XML coverage as artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -85,7 +87,7 @@ jobs:
args: >
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.repository_owner }}_federation-registry
-Dsonar.sources=app
-Dsonar.sources=fed_reg
-Dsonar.tests=tests
-Dsonar.python.version=${{ matrix.python-version }}
-Dsonar.python.coverage.reportPaths=coverage.xml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# VSCode and other IDEs
**/.vscode
**/.vscode/**
!**/.vscode/launch.json

# Python Build
**/__pycache__
Expand Down
61 changes: 61 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File and Dependencies",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Uvicorn: FastAPI App",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": ["fed_reg.main:app", "--reload"],
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Pytest: Specific test",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["${lineNumber}"],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Pytest: Specific file",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["${relativeFile}"],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Pytest: Specific folder",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["${relativeFileDirname}"],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Pytest: All",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": ["${workspaceFolder}/tests"],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
Loading
Loading