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

Release/1.1.20231129 #212

Merged
merged 188 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
4eade30
update README
Taniya-Das Sep 11, 2023
b35d238
Bump urllib3 from 2.0.4 to 2.0.5
dependabot[bot] Sep 20, 2023
a872ef7
Example scripts: how to authenticate as service account, and how to u…
josvandervelde Sep 21, 2023
313df0d
Merge pull request #158 from aiondemand/dependabot/pip/urllib3-2.0.5
Taniya-Das Sep 21, 2023
43648df
Merge pull request #159 from aiondemand/feature/example-authenticate-…
josvandervelde Sep 22, 2023
7ea433f
Bump bibtexparser from 1.4.0 to 1.4.1
dependabot[bot] Sep 22, 2023
a0258c6
Merge pull request #160 from aiondemand/dependabot/pip/bibtexparser-1…
Taniya-Das Sep 25, 2023
1460029
Bump pre-commit from 3.4.0 to 3.5.0
dependabot[bot] Oct 16, 2023
2d24693
Merge pull request #163 from aiondemand/dependabot/pip/pre-commit-3.5.0
Taniya-Das Oct 16, 2023
0e05af4
Bump urllib3 from 2.0.5 to 2.0.7
dependabot[bot] Oct 18, 2023
ba12dc4
Add datetime_delete to concept, make sure normal deletion is soft, ad…
josvandervelde Oct 18, 2023
308531f
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Oct 18, 2023
a16d7da
Bump fastapi from 0.103.1 to 0.104.0
dependabot[bot] Oct 19, 2023
9a77119
Test deletion of agent (agent.email, agent.phonenumber and agent.agen…
josvandervelde Oct 19, 2023
24fdd31
Deletion of ai_asset, resource and person; Note is now a non-enum tab…
josvandervelde Oct 19, 2023
634a528
Fix unique constraint for platform, platform_identifier and non-null-…
josvandervelde Oct 20, 2023
23e4b7c
Added deletion to docker-compose; tested deletion manually
josvandervelde Oct 20, 2023
c18cdfa
Merge pull request #165 from aiondemand/dependabot/pip/fastapi-0.104.0
josvandervelde Oct 20, 2023
e60ad31
Merge pull request #164 from aiondemand/dependabot/pip/urllib3-2.0.7
josvandervelde Oct 20, 2023
96796d0
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Oct 20, 2023
51d9569
Documentation of deletion
josvandervelde Oct 20, 2023
0b89fe6
typo
josvandervelde Oct 20, 2023
e41b289
Config: hard-deletion after a week
josvandervelde Oct 20, 2023
2ee98c2
Add location to Agent
josvandervelde Oct 23, 2023
b8b3623
Add location to example connectors
josvandervelde Oct 23, 2023
4279aa1
Move date_published from AIAsset to AIResource
josvandervelde Oct 23, 2023
469afdc
Moved creator from AIResource to AIAsset
josvandervelde Oct 23, 2023
091c6c4
Relevant_link
josvandervelde Oct 23, 2023
1867ec3
Add location to event
josvandervelde Oct 23, 2023
917b286
Test adding overlapping keywords in different post requests
josvandervelde Oct 23, 2023
5e2583d
News categories
josvandervelde Oct 24, 2023
2c39d80
Nullable is_accesible_for_free
josvandervelde Oct 24, 2023
3980003
Bump datasets from 2.14.5 to 2.14.6
dependabot[bot] Oct 24, 2023
704be44
Bump mysql-connector-python from 8.1.0 to 8.2.0
dependabot[bot] Oct 25, 2023
3696e27
Bump pytest from 7.4.2 to 7.4.3
dependabot[bot] Oct 25, 2023
5413bc1
merge conflict in readme
Taniya-Das Oct 30, 2023
72db5cf
Bump sqlmodel from 0.0.8 to 0.0.11
dependabot[bot] Oct 30, 2023
14b2fc9
ResourceAIAssetRouter inheriting RessourceRouter with polymorphism of…
jsmatias Oct 31, 2023
7ba4dcc
Relationships between resources: relevant_to, relevant_resource etc; …
josvandervelde Oct 31, 2023
158fbf5
Updated educational_resource, adding (amongst others) level, pace, pr…
josvandervelde Oct 31, 2023
10ff0ea
removed script/run_mysql_server.sh
Taniya-Das Oct 31, 2023
15b34d8
Generic feature to get the actual data from the AI assets.
jsmatias Oct 31, 2023
8f06630
Fix deletion of location.geo and location.address, and remove unneede…
josvandervelde Nov 1, 2023
52326d4
Deletion of dataset.size
josvandervelde Nov 1, 2023
7a15e2f
Merge pull request #167 from aiondemand/dependabot/pip/datasets-2.14.6
josvandervelde Nov 1, 2023
c12bc8a
Merge pull request #169 from aiondemand/dependabot/pip/mysql-connecto…
josvandervelde Nov 1, 2023
74e173e
Bump fastapi from 0.104.0 to 0.104.1
dependabot[bot] Nov 1, 2023
a6f2821
Merge pull request #170 from aiondemand/dependabot/pip/pytest-7.4.3
josvandervelde Nov 1, 2023
e2a44ec
Merge pull request #172 from aiondemand/dependabot/pip/fastapi-0.104.1
josvandervelde Nov 1, 2023
e151e44
Merge pull request #173 from aiondemand/dependabot/pip/sqlmodel-0.0.11
josvandervelde Nov 1, 2023
c3d6017
Merge pull request #166 from aiondemand/feature/soft-delete
josvandervelde Nov 1, 2023
6be4327
Resolved merge conflict with develop (soft-deletion)
josvandervelde Nov 2, 2023
7bb8d37
Modified README.md
Taniya-Das Nov 3, 2023
c95f757
further modifications
Taniya-Das Nov 3, 2023
56ab0dd
further modifications
Taniya-Das Nov 3, 2023
858de62
further modifications
Taniya-Das Nov 3, 2023
50f777a
Bump uvicorn from 0.23.2 to 0.24.0.post1
dependabot[bot] Nov 6, 2023
2b1e0a9
Merge pull request #176 from aiondemand/dependabot/pip/uvicorn-0.24.0…
Taniya-Das Nov 7, 2023
6aaa894
Bump responses from 0.23.3 to 0.24.0
dependabot[bot] Nov 7, 2023
56918ab
Merge pull request #177 from aiondemand/dependabot/pip/responses-0.24.0
Taniya-Das Nov 7, 2023
9ffd983
Bump httpx from 0.25.0 to 0.25.1
dependabot[bot] Nov 7, 2023
b92ce87
Merge pull request #178 from aiondemand/dependabot/pip/httpx-0.25.1
Taniya-Das Nov 7, 2023
ac9c4ab
Add contact as separate entity, making it easy to add contact informa…
josvandervelde Nov 7, 2023
6c16112
Resolved merge conflicts with develop
josvandervelde Nov 7, 2023
8454e95
Renamed platform_identifier to platform_resource_identifier
josvandervelde Nov 7, 2023
1e96b86
Making sure the deletion triggers are created once
josvandervelde Nov 8, 2023
be5e261
corrections made
Taniya-Das Nov 8, 2023
a5b0010
Test post duplicate email
josvandervelde Nov 8, 2023
49ec3bf
Cleanup of testcase
josvandervelde Nov 8, 2023
2c10ceb
Test upload multiple things with same editors
josvandervelde Nov 8, 2023
9a3834c
Merge pull request #174 from aiondemand/feature/update_README
josvandervelde Nov 8, 2023
55fa108
Add Text entity, replaced resource.description with resource.descript…
josvandervelde Nov 8, 2023
fe5fbd9
Add .content (Text) to educational_resource, news, publications, event
josvandervelde Nov 8, 2023
b7cd47f
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 8, 2023
d6ab65b
Cleanup
josvandervelde Nov 9, 2023
a6bebc9
Merge pull request #180 from aiondemand/bugfix/create_triggers_once
josvandervelde Nov 9, 2023
7836882
Resolved comments regarding the changes to retrieve the content from …
jsmatias Nov 9, 2023
fb96817
Nested serialization: making sure dataset.has_part deserializes to da…
josvandervelde Nov 9, 2023
f9e458c
Ignoring huggingface uploader tests for now
josvandervelde Nov 9, 2023
bd201eb
Added pytest.mak.skip to huggingface/test_dataset_uploader.py::test_h…
jsmatias Nov 9, 2023
77e32e5
Another red test, ignore for now
josvandervelde Nov 9, 2023
07113ae
Merge pull request #183 from aiondemand/bugfix/ignore_huggingface_tes…
josvandervelde Nov 9, 2023
19fa6f4
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 9, 2023
07d92d9
Added pytest.mak.skip to another test to ignore an error for now.
jsmatias Nov 9, 2023
3938c47
Resolved comment on the absence of a encoding format. Content-Type wo…
jsmatias Nov 9, 2023
464475c
Resolved conflict with pytest.mark.skip uploader/huggingface/test..
jsmatias Nov 9, 2023
be5d071
Minor change
jsmatias Nov 9, 2023
044a3e3
Merge pull request #175 from aiondemand/feature/get-actual-data
jsmatias Nov 9, 2023
8958759
Making sure platform deletion works as planned: using hard-deletion h…
josvandervelde Nov 10, 2023
2ce0ba4
Bump pytest-xdist from 3.3.1 to 3.4.0
dependabot[bot] Nov 13, 2023
0f0c93f
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 13, 2023
303a040
Added 2 delete triggers after review
josvandervelde Nov 13, 2023
8108ce0
Merge pull request #182 from aiondemand/feature/data_migration_issues
josvandervelde Nov 13, 2023
e1e6055
Merge pull request #185 from aiondemand/dependabot/pip/pytest-xdist-3…
josvandervelde Nov 13, 2023
ac64d0c
Merge pull request #184 from aiondemand/bugfix/platform-deletion
josvandervelde Nov 13, 2023
ed35c66
Update HF connector
andrejridzik Nov 13, 2023
499e5c3
Update connectors to create valid `AIoDEntry`
andrejridzik Nov 13, 2023
a20de4f
Fix formatting issues
andrejridzik Nov 13, 2023
7a1f881
Cleanup of huggingface dataset connector
josvandervelde Nov 14, 2023
5507aa9
Simplification of `limit` in HF connector
andrejridzik Nov 14, 2023
4199291
Using the newest huggingface_hub version
josvandervelde Nov 14, 2023
7566f8e
Merge branch 'feature/update-dataset-connectors' of https://github.co…
josvandervelde Nov 14, 2023
8592972
Add pytz dependency (supposedly part of the removed dependency datasets)
josvandervelde Nov 14, 2023
da38967
Merge pull request #186 from aiondemand/feature/update-dataset-connec…
josvandervelde Nov 14, 2023
f4613f0
Update example-connector resources
josvandervelde Nov 14, 2023
559c86c
Huggingface dataset connector: bugfixes
josvandervelde Nov 14, 2023
28bc6e0
Making NamedRelation and Platform lowercase (to avoid collisions betw…
josvandervelde Nov 14, 2023
338e6d8
Docker compose profiles
josvandervelde Nov 14, 2023
1771018
bugfix for openml
josvandervelde Nov 14, 2023
e5fe0d1
Rerun connectors on empty db
josvandervelde Nov 14, 2023
23497e9
Fixes for openml and zenodo
josvandervelde Nov 15, 2023
96b36a2
Create directories for the data directory, to avoid permission denied…
josvandervelde Nov 15, 2023
996a527
Convenience script for reverting back to a clean state
josvandervelde Nov 15, 2023
bfb0d5e
Update README: describe profiles
josvandervelde Nov 15, 2023
dff0693
Make sure enums that are used as examples are lowercase
josvandervelde Nov 15, 2023
1b4e53b
Merge pull request #191 from aiondemand/bugfix/connector-problems
josvandervelde Nov 15, 2023
e6ed8b9
Merge pull request #192 from aiondemand/feature/bugfix-connectors-dat…
josvandervelde Nov 15, 2023
7c85d47
Some machines were throwing errors because it took too long for the A…
josvandervelde Nov 15, 2023
215bd8b
Merge pull request #193 from aiondemand/bugfix/longer-timeout-for-api…
josvandervelde Nov 15, 2023
a9db5ad
Fixing .env file locations
josvandervelde Nov 15, 2023
006cc44
Merge pull request #195 from aiondemand/bugfix/develop-fails-due-to-w…
josvandervelde Nov 15, 2023
a4e0b69
Better comments on environment files
josvandervelde Nov 15, 2023
ca163c6
Merge pull request #196 from aiondemand/bugfix/develop-fails-due-to-w…
josvandervelde Nov 15, 2023
b4198f0
Bump python-keycloak from 3.3.0 to 3.7.0
dependabot[bot] Nov 15, 2023
7b5b928
Bump urllib3 from 2.0.7 to 2.1.0
dependabot[bot] Nov 15, 2023
3c45e03
Bump responses from 0.24.0 to 0.24.1
dependabot[bot] Nov 15, 2023
e4dca15
Bump huggingface-hub from 0.19.1 to 0.19.3
dependabot[bot] Nov 15, 2023
d00d3cd
Merge pull request #187 from aiondemand/dependabot/pip/python-keycloa…
josvandervelde Nov 15, 2023
abf2a4c
Merge pull request #188 from aiondemand/dependabot/pip/urllib3-2.1.0
josvandervelde Nov 15, 2023
efc8169
Merge pull request #189 from aiondemand/dependabot/pip/responses-0.24.1
josvandervelde Nov 15, 2023
95b5a81
Merge pull request #194 from aiondemand/dependabot/pip/huggingface-hu…
josvandervelde Nov 15, 2023
1091a32
Total counts and detailed counts per resource
josvandervelde Nov 17, 2023
da2eebe
Make sure all example-resources have platform=example
josvandervelde Nov 17, 2023
9d1498f
Bump huggingface-hub from 0.19.3 to 0.19.4
dependabot[bot] Nov 17, 2023
1373a3e
Merge pull request #197 from aiondemand/feature/total-counts
josvandervelde Nov 17, 2023
429e8ac
Merge pull request #198 from aiondemand/dependabot/pip/huggingface-hu…
josvandervelde Nov 17, 2023
ff81d4a
Using a DbSession and an EngineSingleton to inject the engine, instea…
josvandervelde Nov 17, 2023
6b21e20
Resolved merge conflicts with develop (add total counts)
josvandervelde Nov 17, 2023
0ac1fe5
Bump sqlmodel from 0.0.11 to 0.0.12
dependabot[bot] Nov 20, 2023
6b3e067
Fixed typo: allways
josvandervelde Nov 21, 2023
47b254c
Removed unused engine from tests
josvandervelde Nov 21, 2023
799f63e
Merge pull request #199 from aiondemand/feature/cleaner-sql-engine-de…
josvandervelde Nov 21, 2023
8547eea
Bump pytest-xdist from 3.4.0 to 3.5.0
dependabot[bot] Nov 22, 2023
9de182b
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 22, 2023
b46857c
Annotations work differently in SQLModel version, fixed using new cod…
josvandervelde Nov 22, 2023
b093220
Removing PRAGMA foreign_keys=OFF, because new SQLModel does not obey …
josvandervelde Nov 22, 2023
077a85f
Making it possible to remove a relationship by adding None in the jso…
josvandervelde Nov 22, 2023
5f52212
Minor cleanup
josvandervelde Nov 22, 2023
0601d7c
Merge pull request #201 from aiondemand/dependabot/pip/pytest-xdist-3…
josvandervelde Nov 22, 2023
4e053bc
Merge pull request #200 from aiondemand/dependabot/pip/sqlmodel-0.0.12
josvandervelde Nov 24, 2023
59ceeb2
random
Taniya-Das Nov 24, 2023
f00a593
Bump httpx from 0.25.1 to 0.25.2
dependabot[bot] Nov 27, 2023
e20fe6e
correction zenodo connector creator
Taniya-Das Nov 27, 2023
2796cb0
fixed hugging face connector creator field
Taniya-Das Nov 27, 2023
4f54362
added field type check in resources_with_relations and made creators …
Taniya-Das Nov 27, 2023
7155396
first version of feature elastic search ready
AdrianAlcolea Nov 28, 2023
f0f05e1
Merge pull request #203 from aiondemand/dependabot/pip/httpx-0.25.2
josvandervelde Nov 28, 2023
aecf9db
Bump elasticsearch from 8.10.1 to 8.11.0
dependabot[bot] Nov 28, 2023
8788fbd
Merge pull request #206 from aiondemand/dependabot/pip/elasticsearch-…
josvandervelde Nov 28, 2023
18304c3
Elastic search: better Swagger documentation (#205)
josvandervelde Nov 28, 2023
0bb6c06
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
Taniya-Das Nov 28, 2023
e8af2d4
resovled PR comments
Taniya-Das Nov 28, 2023
8eba76d
resolved comments
Taniya-Das Nov 28, 2023
05cfb14
Merge pull request #204 from aiondemand/bugfix/dataset_connector_creator
Taniya-Das Nov 28, 2023
e17a30e
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
Taniya-Das Nov 28, 2023
4e19b1c
Feature/elastic search db performance (#207)
josvandervelde Nov 28, 2023
0a23bb7
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
Taniya-Das Nov 28, 2023
7787fc9
Adding descriptions to Path and Query parameters (to improve Swagger …
josvandervelde Nov 28, 2023
2ac2d8f
Change the default Swagger example for list from a list with a single…
josvandervelde Nov 28, 2023
7abe052
Remove schema query parameter if there is only a single option
josvandervelde Nov 28, 2023
b9c51d8
DCAT-AP: description can be none. This resulted in an exception (#209)
josvandervelde Nov 28, 2023
234fb22
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
Taniya-Das Nov 28, 2023
48ebcd4
Add version in swagger, better docker image names
josvandervelde Nov 28, 2023
8d73992
Added some authors to pyproject.toml
josvandervelde Nov 28, 2023
97a4307
Updated license
josvandervelde Nov 28, 2023
9191fdd
cleanup
josvandervelde Nov 28, 2023
4b0fa7e
Better Swagger name and description
josvandervelde Nov 28, 2023
f055362
Removed docstring of AIoDConcept, because it was shown for (almost) a…
josvandervelde Nov 28, 2023
fe650ad
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 28, 2023
ffa36b8
Merge pull request #210 from aiondemand/feature/version_in_swagger
josvandervelde Nov 29, 2023
63fb2a0
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
Taniya-Das Nov 29, 2023
293fbca
Merge branch 'develop' of https://github.com/aiondemand/AIOD-rest-api…
josvandervelde Nov 29, 2023
283fa70
making content_url optional
Taniya-Das Nov 29, 2023
15368cb
Changed annotation syntax: from 'field: Annotated[int, Query()]' to f…
josvandervelde Nov 29, 2023
817e6d8
Removed none option for query params limit and offset: there are alre…
josvandervelde Nov 29, 2023
4920f7f
Merge pull request #211 from aiondemand/bugfix/optional_content_url
josvandervelde Nov 29, 2023
db83f65
Merge pull request #208 from aiondemand/feature/improve-swagger-docum…
josvandervelde Nov 29, 2023
d00d611
Version bump of our project
josvandervelde Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
scripts
venv
data
**.DS_Store
10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ KEYCLOAK_ADMIN_PASSWORD=password
KEYCLOAK_CLIENT_SECRET="QJiOGn09eCEfnqAmcPP2l4vMU8grlmVQ"
REDIRECT_URIS=http://${HOSTNAME}/docs/oauth2-redirect
POST_LOGOUT_REDIRECT_URIS=http://${HOSTNAME}/aiod-auth/realms/aiod/protocol/openid-connect/logout

#ELASTICSEARCH
ES_USER=elastic
ES_PASSWORD=changeme
ES_DISCOVERY_TYPE=single-node
ES_ROLE="edit_aiod_resources"
ES_JAVA_OPTS="-Xmx256m -Xms256m"

#LOGSTASH
LS_JAVA_OPTS="-Xmx256m -Xms256m"
4 changes: 2 additions & 2 deletions .github/workflows/dockerized-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build the docker image
run: docker build --tag ai4eu_server_demo:latest -f Dockerfile .
run: docker build --tag aiod_metadata_catalogue:latest -f Dockerfile .

- name: Run docker container and pytest tests
run: |
docker run -e KEYCLOAK_CLIENT_SECRET="mocked_secret" --entrypoint "" ai4eu_server_demo sh -c "pip install \".[dev]\" && pytest tests -s"
docker run -e KEYCLOAK_CLIENT_SECRET="mocked_secret" --entrypoint "" aiod_metadata_catalogue sh -c "pip install \".[dev]\" && pytest tests -s"



Expand Down
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Project Specific

# data/ is intended for database data from the mysql container
data/

# Generated Logstash configuration
logstash/config/config/logstash.yml
logstash/config/config/pipelines.yml
logstash/config/pipeline
logstash/config/sql





# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -113,6 +124,7 @@ venv/
ENV/
env.bak/
venv.bak/
**.DS_Store

# Spyder project settings
.spyderproject
Expand All @@ -135,4 +147,4 @@ dmypy.json
# Pyre type checker
.pyre/

.vscode
.vscode
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ repos:
name: mypy src
files: src/.*
additional_dependencies:
- types-requests
- types-python-dateutil
- types-pytz
- types-requests
- types-setuptools
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 OpenML Labs
Copyright (c) 2023 AI On Demand

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
87 changes: 18 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ For development:
- Additional 'mysqlclient' dependencies. Please have a look at [their installation instructions]
(https://github.com/PyMySQL/mysqlclient#install).

## Production environment

For production environments elasticsearch recommends -Xss4G and -Xmx8G for the JVM settings.\
This parameters can be defined in the .env file.
See the [elasticsearch guide](https://www.elastic.co/guide/en/logstash/current/jvm-settings.html).

## Installation

Expand All @@ -67,40 +72,22 @@ Information on how to install Docker is found in [their documentation](https://d

### Using docker compose
```bash
docker compose up
docker compose --profile examples up
```

starts the MYSQL Server, the REST API, Keycloak for Identy and access management and Nginx for reverse proxing. \
Once started, you should be able to visit the REST API server at: http://localhost and Keycloak at http://localhost/aiod-auth \
To authenticate to the REST API swagger interface the predefined user is: user, and password: password \
To authenticate as admin to Keycloak the predefined user is: admin and password: password \
To use a different DNS hostname replace localhost with it in .env and src/config.toml \
This configuration is intended for development, DO NOT use it in production.

Use the following instructions if you prefer to use Docker instead of Docker Compose.

### Starting a MySQL Server

We use the default [MySQL Docker image](https://hub.docker.com/_/mysql).
By default, the database is stored within the docker container and will thus be deleted when the container is removed.
Instructions on using a persistent storage can be found at the end of this section.

First, we define a docker network to allow our server to be reachable from other docker containers:

```bash
docker network create sql-network
```

Then, start the MySQL Server:

To turn if off again, use
```bash
docker run -e MYSQL_ROOT_PASSWORD=ok --name sqlserver --network sql-network -d mysql
docker compose --profile examples down
```

That's all! You should be able to connect to the server now, though no database is present yet:

```bash
docker run -it --network sql-network --rm mysql mysql -hsqlserver -uroot -pok
```
To connect to the database use `./scripts/database-connect.sql`.

```bash
mysql> SHOW DATABASES;
Expand All @@ -115,48 +102,18 @@ mysql> SHOW DATABASES;
4 rows in set (0.03 sec)
```

For ease of use, you can also make use of the script in `scripts/run_mysql_server.sh`.

#### Persistent Storage

The data is persistent when simply stopping and restarting the server:

```bash
docker stop sqlserver
docker start sqlserver
```

However, all data is lost when the container is deleted.
To ensure data can persist even if the container is deleted, allow the Docker container to write to a directory on the
host machine.
To do that, mount a volume by adding `-v /ABSOLUTE/PATH/TO/HOST/DIR:/var/lib/mysql` to the docker command that starts
the server
(it's also possible to create a docker
volume ([docs](https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only))).
If you want to use a path within this repository directory, we recommend naming the directory `data` since then it will
automatically be ignored by git.
For more information, see "Where to Store Data" in the linked documentation.

### Starting the REST API

The repository provides a Dockerfile to run the REST API in a containerized environment.
Now, you can visit the server from your browser at `localhost:8000/docs`.

#### Using the Docker container

First, build the docker image from the dockerfile:
#### Using connectors
You can specify different connectors using

```bash
docker build --tag ai4eu_server_demo:latest -f Dockerfile .
docker compose --profile examples --profile huggingface-datasets --profile openml-datasets up -d
docker compose --profile examples --profile huggingface-datasets --profile openml-datasets down
```

then create a container from that image, remember to forward the port and connect to the right
docker network (alternatively you can use the script at `scripts/run_apiserver.sh`)

```bash
docker run --network sql-network -it --rm -p 8000:8000 --name apiserver ai4eu_server_demo
```

At this point you should be able to visit the server from your browser at `localhost:8000/docs`.
Make sure you use the same profile for `up` and `down`, otherwise some containers might keep
running.

#### Local Installation

Expand Down Expand Up @@ -199,7 +156,7 @@ The `--reload` argument will automatically restart the app if changes are made t
3. Run using DevContainer (see next subsection)

### Authentication
Currently, the code is on default coupled with a keycloak running on test.openml.org. To make
Currently, the code is by default running using the local Keycloak. To make
this work, you need to set an environment variable. You can do this by setting the
`KEYCLOAK_CLIENT_SECRET` in `src/.env`.

Expand All @@ -208,9 +165,6 @@ this work, you need to set an environment variable. You can do this by setting t
KEYCLOAK_CLIENT_SECRET=[SECRET]
```

Please ask Jos van der Velde ([email protected]) for the keycloak secret, and to give your
user the correct roles.

Alternatively, you can connect to a different keycloak instance by modifying `src/.env`. EGI
Checkin can for instance be used on a deployed instance - not on local host. Marco Rorro is the
go-to person to request the usage of the EGI Checkin.
Expand Down Expand Up @@ -255,11 +209,6 @@ You can change this behavior through parameters of the script:
Following the installation instructions above, the server may be reached at `127.0.0.1:8000`.
REST API documentation is automatically built and can be viewed at `127.0.0.1:8000/docs`.

#### Editing Files Locally

While developing the server it is often convenient to edit the files on the host machine.
To avoid rebuilding the docker container each time you edit the files, you can mount the host files into the container.
Mount your repository's `src` directory into the container's `/app` directory by adding `-v $(pwd)/src:/app`.

#### Automatically Restart on Change

Expand Down
18 changes: 13 additions & 5 deletions connectors/fill-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ python3 connectors/synchronization.py \
-c connectors.example.example.ExampleCaseStudyConnector \
-w /opt/connectors/data/example/case_study

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleContactConnector \
-w /opt/connectors/data/example/contact

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleComputationalAssetConnector \
-w /opt/connectors/data/example/computational_asset
Expand All @@ -12,10 +16,6 @@ python3 connectors/synchronization.py \
-c connectors.example.example.ExampleEducationalResourceConnector \
-w /opt/connectors/data/example/educational_resource

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleEventConnector \
-w /opt/connectors/data/example/event

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleExperimentConnector \
-w /opt/connectors/data/example/experiment
Expand All @@ -36,6 +36,10 @@ python3 connectors/synchronization.py \
-c connectors.example.example.ExamplePersonConnector \
-w /opt/connectors/data/example/person

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleEventConnector \
-w /opt/connectors/data/example/event

python3 connectors/synchronization.py \
-c connectors.example.example.ExampleProjectConnector \
-w /opt/connectors/data/example/project
Expand Down Expand Up @@ -82,6 +86,10 @@ python3 connectors/synchronization.py \
-c connectors.example.enum.EnumConnectorOrganisationType \
-w /opt/connectors/data/enum/organisation_type

python3 connectors/synchronization.py \
-c connectors.example.enum.EnumConnectorNewsCategory \
-w /opt/connectors/data/enum/news_category

python3 connectors/synchronization.py \
-c connectors.example.enum.EnumConnectorStatus \
-w /opt/connectors/data/enum/status
-w /opt/connectors/data/enum/status
1 change: 1 addition & 0 deletions connectors/huggingface/datasets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

WORK_DIR=/opt/connectors/data/huggingface/dataset
mkdir -p $WORK_DIR

python3 connectors/synchronization.py \
-c connectors.huggingface.huggingface_dataset_connector.HuggingFaceDatasetConnector \
Expand Down
2 changes: 1 addition & 1 deletion connectors/openml/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ai4eu_server
FROM aiod_metadata_catalogue

COPY cron /etc/cron.d/aiod
COPY datasets.sh /opt/connectors/script/datasets.sh
Expand Down
4 changes: 2 additions & 2 deletions connectors/openml/datasets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ echo $(date -u) "Starting synchronization..."
PYTHONPATH=/app /usr/local/bin/python3 /app/connectors/synchronization.py \
-c $CONNECTOR \
-w $WORK_DIR \
--from-identifier 4500 \
--save-every 100 > ${WORK_DIR}/connector.log 2>&1
--from-identifier 1 \
--save-every 100 >> ${WORK_DIR}/connector.log 2>&1
echo $(date -u) "Synchronization Done."
2 changes: 1 addition & 1 deletion connectors/zenodo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ai4eu_server
FROM aiod_metadata_catalogue

COPY cron /etc/cron.d/aiod
COPY datasets.sh /opt/connectors/script/datasets.sh
Expand Down
2 changes: 1 addition & 1 deletion connectors/zenodo/datasets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ PYTHONPATH=/app /usr/local/bin/python3 /app/connectors/synchronization.py \
-c $CONNECTOR \
-w $WORK_DIR \
--from-date "2023-08-01" \
--save-every 100 > ${WORK_DIR}/connector.log 2>&1
--save-every 100 >> ${WORK_DIR}/connector.log 2>&1
echo $(date -u) "Synchronization Done."
Empty file added data/connectors/.gitkeep
Empty file.
Empty file added data/deletion/.gitkeep
Empty file.
Empty file added data/elasticsearch/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions deletion/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM aiod_metadata_catalogue

COPY cron /etc/cron.d/aiod
COPY delete_old.sh /opt/deletion/script/delete_old.sh
COPY entry.sh /opt/deletion/script/entry.sh

USER root
RUN apt -y install cron
RUN chmod +x /etc/cron.d/aiod /opt/deletion/script/delete_old.sh
RUN crontab /etc/cron.d/aiod

WORKDIR /app
1 change: 1 addition & 0 deletions deletion/cron
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
40 * * * * bash /opt/deletion/script/delete_old.sh >> /opt/deletion/data/deletion-cron.log 2>&1
16 changes: 16 additions & 0 deletions deletion/delete_old.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

WORK_DIR=/opt/deletion/data/

another_instance()
{
echo $(date -u) "This script is already running in a different thread."
exit 1
}
exec 9< "$0"
flock -n -x 9 || another_instance

echo $(date -u) "Starting deletion..."
PYTHONPATH=/app /usr/local/bin/python3 /app/database/deletion/hard_delete.py \
--time-threshold-minutes 10080 > ${WORK_DIR}/deletion.log 2>&1
echo $(date -u) "Deletion Done."
7 changes: 7 additions & 0 deletions deletion/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# If this directory does not exist, the cron job cannot log (and cannot run)
mkdir -p /opt/deletion/data/

# Run cron on the foreground with log level WARN
/usr/sbin/cron -f -l 4
Loading
Loading