In the SWI-Prolog console, you can use the following predicates to interact with the remote CLP service:
api_config/1: Set the URL (url(...)) and API key (key(...)) for the remote CLP service.- The remote CLP service URL is
http://localhost:3000 - Example for production deployment:
api_config([url('https://remote-clp.kube.isc.heia-fr.ch/api'), key('<some_jwt>')]).
- The remote CLP service URL is
- See the examples in
/remote_clp_client/examplesfor more information on how to use the client. - There is a admin interface available at
http://localhost:3000/adminto create tokens for the users.
- Install go v1.22.1 and python v3.11.8
- Run
docker compose up rabbitmq -d - Configure kubectl to have acces to the cluster (download the kubeconfig file from the rancher and set the KUBECONFIG environment variable to the path of the file or put it in ~/.kube/config)
- Run
kubectl -n remote-clp create secret generic remote-clp-admin-password --from-literal=password=<admin_password>to create the secret with the admin password for production - Run
kubectl -n remote-clp create secret generic remote-clp-jwt-secret --from-literal=secret=<jwt_secret>to create the secret with the jwt secret for production - Run (ideally in a virtual environment but not necessary)
pip install -r requirements.txtin/remote_clp_service/worker - Run
go run main.goin/remote_clp_service/job_dispatcher - Run
swipl -l ./remote_clp.plin/remote_clp_clientto interact with the client- Alternatively, you can use the example programs in
/remote_clp_client/examplesby runningswipl -l ./examples/<example_file>in/remote_clp_client. Don't forget set the correct url and API key in the example files.
- Alternatively, you can use the example programs in
- Create a
.envfile in the root directory with the following content:ADMIN_PASSWORD=<admin_password>JWT_SECRET=<jwt_secret>
- Run
docker compose up -d - Follow the step 8 from the local setup
To run the tests on the example programs:
- Add the token in the
api_configpredicate at the top of the file - Run
swipl -g run_tests -t halt tests.plin/remote_clp_client