Setup Sbert_eduplex

Setup Sbert_eduplex

Directory structure:

  • The file called server.py is the main file to run the application

  • .env should be used to write down the initial parameters of the application. Logs should be automatically created.

  • requirements.txt contains the requirements

How to develop sbert with docker

  • Run docker-compose-socket-sbert.yml (change the image version to force a rebuild)

  • This will make the service available in localhost:5000 without SSL

How to build sbert service for production

  • Change the image version in docker-compose-sbert.yml (optionally use dockerfile docker/child/Dockerfile for a quick build without updating pip dependencies or docker/Dockerfile for a slower build from empty image)

  • Run docker-compose up will create a new version tagged image

  • Login to AWS ECR aws ecr-public get-login-password --region us-east-1 --profile prdedupl | docker login --username AWS --password-stdin public.ecr.aws/eduplex_api (change prdedupl with the name of your aws cli or default if you do not have many profiles)

  • Push the image docker push <image_tag> (image_tag from yml file)

technical notes

  • in pycharm there may be problems with dockers permissions, after locally installing Dockers and pycharm plugin, the following may be needed:

sudo chmod a+rwx /var/run/docker.sock
sudo chmod a+rwx /var/run/docker.pid

Last updated