Hi,
I am currently using the Knowage Docker Server on Windows 10 and I would like to create a dataset using the Knowage Python Server but I am struggling to make it work.
Here is my docker-compose file:
version: "3.1"
services:
portainer:
image: portainer/portainer
command: -H unix:///var/run/docker.sock
ports:
- 9000:9000
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
knowage:
container_name: knowage
image: knowagelabs/knowage-server-docker:8.1.0-SNAPSHOT
hostname: knowage
depends_on:
- knowagedb
- knowagecache
- hazelcast
ports:
- "8080:8080"
networks:
- main
environment:
- DB_HOST=$DB_HOST
- DB_PORT=$DB_PORT
- DB_DB=$DB_DB
- DB_USER=$DB_USER
- DB_PASS=$DB_PASS
- CACHE_DB_HOST=$CACHE_DB_HOST
- CACHE_DB_PORT=$CACHE_DB_PORT
- CACHE_DB_DB=$CACHE_DB_DB
- CACHE_DB_USER=$CACHE_DB_USER
- CACHE_DB_PASS=$CACHE_DB_PASS
- HMAC_KEY=$HMAC_KEY
- PASSWORD_ENCRYPTION_SECRET=$PASSWORD_ENCRYPTION_SECRET
- PUBLIC_ADDRESS=localhost
- HAZELCAST_HOSTS=hazelcast
- HAZELCAST_PORT=5701
volumes:
- ./resources:/home/knowage/apache-tomcat/resources
hazelcast:
image: hazelcast/hazelcast:3.6.5
networks:
- main
environment:
- JAVA_OPTS=-Dhazelcast.local.publicAddress=hazelcast -Dhazelcast.config=/opt/hazelcast/hazelcast.xml
volumes:
- ./hazelcast-server.xml:/opt/hazelcast/hazelcast.xml
knowagepython:
image: knowagelabs/knowage-python-docker:8.1.0-SNAPSHOT
hostname: knowagepython
environment:
- HMAC_KEY=$HMAC_KEY
- KNOWAGE_PUBLIC_ADDRESS=http://localhost:8080
- PUBLIC_ADDRESS=localhost
networks:
- main
volumes:
- "db:/var/lib/mysql"
ports:
- "5000:5000"
knowager:
image: knowagelabs/knowage-r-docker:8.1.0-SNAPSHOT
environment:
- HMAC_KEY=$HMAC_KEY
networks:
- main
knowagedb:
image: mariadb:10.3
environment:
- MYSQL_USER=$DB_USER
- MYSQL_PASSWORD=$DB_PASS
- MYSQL_DATABASE=$DB_DB
- MYSQL_RANDOM_ROOT_PASSWORD=yes
networks:
- main
volumes:
- ./mariadb-data:/var/lib/mysql
knowagecache:
image: mariadb:10.3
environment:
- MYSQL_USER=$CACHE_DB_USER
- MYSQL_PASSWORD=$CACHE_DB_PASS
- MYSQL_DATABASE=$CACHE_DB_DB
- MYSQL_RANDOM_ROOT_PASSWORD=yes
networks:
- main
volumes:
- ./mariadb-cache:/var/lib/mysql
networks:
main:
volumes:
portainer_data:
db:
Following the documentation, I created 2 variables of category PYTHON_CONFIGURATION:
python.virtualenv.0.backend.url (http://knowagepython:5000)
python.virtualenv.0.frontend.url (http://knowagepython:5000)
Then I went to the Roles management section and checked the EDIT PYTHON SCRIPTS option.
Finally, I create my dataset and when checking the environment by selecting the python.virtualenv.0.backend.url I can see that the REST method is working in the logs (code 200) and I can see all the Python libraries available
But when trying the run my Python script I get a 401 error message (unauthorized).
2021-07-27 13:37:33 +0000] [36] [DEBUG] POST /dataset
172.27.0.7 - - [27/Jul/2021:13:37:33 +0000] "POST /dataset HTTP/1.1" 401 12 "-" "Jakarta Commons-HttpClient/3.0.1"
Could you please help me out or tell me what I am doing wrong?
Thanks in advance.
Regards,