For development, the API is addressed through an apache reverse proxy, which secures authentication via oidc. Apache is started using a docker container running on port 8000.
Clone the cloud-api repository and change into development branch with
git clone -b dev https://github.com/deNBI/cloud-api.git
cd cloud-api/app
Place client.pem and CA.pem(https://github.com/deNBI/cloud-portal/tree/master/config/keys) in cloud-api/app/keys.
In order to start the API you have to copy the setEnv.sh.in to setEnv.sh and set the different environment variables in the script.
There are several make commands available, you will find an overview with documentation running:
make help
To start the API you just need to run
make dev-build
or
make dev
You can now reach the django developement server locally with http://localhost:8000.
Changes to the API are updated on the run!
To allocate groups to the resources of facilitys you need to add the information of the new compute center to the Database via django-admin.
You can find the different ResourceIDs of the resources of your facility in the Perun GUI, on the bottom right is a small button which can open extended settings. If you click it you can see the different ID's in the resource overview of the facility.
You can start a redis container and your celery tasks scheduling defined in the celery config with:
make start_celery
Celery automatically detects tasks in a project across modules when they are located in a tasks.py file. It is important to specify the module in the decorator of the new task so that the tasks can be detected.
@shared_task(name='projects.check_lifetime')
def check_lifetime():
...
Then the tasks are detected automatically and can be added to the beat scheduler in the celery config e.g. as periodic tasks:
CELERY_BEAT_SCHEDULE = {
'lifetime_check': {
'task': 'projects.check_lifetime',
'schedule': crontab(minute=0, hour=9),
# 'schedule': 30.0,
}, }
If you want to know how to create a task visit First steps with celery.
Content type
Image
Digest
sha256:42c9ff4f1…
Size
643.2 MB
Last updated
over 3 years ago
docker pull denbicloud/cloud-api:dev