diff --git a/.azure-template.env b/.azure-template.env index 6414bed..dc4f045 100644 --- a/.azure-template.env +++ b/.azure-template.env @@ -17,4 +17,4 @@ AI_GITHUB_PAT=github-user-for-website-cloning LANGCHAIN_TRACING_V2=true LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" LANGCHAIN_API_KEY="langsmith-api-key" -LANGCHAIN_PROJECT="guidance-engine" +LANGCHAIN_PROJECT="virtual-contributor-engine-guidance" diff --git a/.github/workflows/build-deploy-k8s-dev-azure.yml b/.github/workflows/build-deploy-k8s-dev-azure.yml index 028d895..d9481ba 100644 --- a/.github/workflows/build-deploy-k8s-dev-azure.yml +++ b/.github/workflows/build-deploy-k8s-dev-azure.yml @@ -20,8 +20,8 @@ jobs: - name: "Build & Push image" run: | - docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:latest - docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest + docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} deploy: runs-on: ubuntu-latest @@ -44,7 +44,7 @@ jobs: container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }} container-registry-username: ${{ secrets.REGISTRY_USERNAME }} container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} - secret-name: alkemio-guidance-engine-secret + secret-name: alkemio-virtual-contributor-engine-guidance-secret - uses: azure/setup-kubectl@v3.2 with: @@ -56,6 +56,6 @@ jobs: manifests: | manifests/25-genai-deployment-dev.yaml images: | - ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} imagepullsecrets: | - alkemio-guidance-engine-secret + alkemio-virtual-contributor-engine-guidance-secret diff --git a/.github/workflows/build-deploy-k8s-sandbox-azure.yml b/.github/workflows/build-deploy-k8s-sandbox-azure.yml index 674f3ff..12c4c25 100644 --- a/.github/workflows/build-deploy-k8s-sandbox-azure.yml +++ b/.github/workflows/build-deploy-k8s-sandbox-azure.yml @@ -19,8 +19,8 @@ jobs: - name: "Build & Push image" run: | - docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:latest - docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest + docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} deploy: runs-on: ubuntu-latest steps: @@ -42,7 +42,7 @@ jobs: container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }} container-registry-username: ${{ secrets.REGISTRY_USERNAME }} container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} - secret-name: alkemio-guidance-engine-secret + secret-name: alkemio-virtual-contributor-engine-guidance-secret - uses: azure/setup-kubectl@v3.2 with: @@ -54,6 +54,6 @@ jobs: manifests: | manifests/25-genai-deployment-dev.yaml images: | - ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} imagepullsecrets: | - alkemio-guidance-engine-secret + alkemio-virtual-contributor-engine-guidance-secret diff --git a/.github/workflows/build-deploy-k8s-test-azure.yml b/.github/workflows/build-deploy-k8s-test-azure.yml index 93d7d84..d7eed99 100644 --- a/.github/workflows/build-deploy-k8s-test-azure.yml +++ b/.github/workflows/build-deploy-k8s-test-azure.yml @@ -19,8 +19,8 @@ jobs: - name: "Build & Push image" run: | - docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:latest - docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest + docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} deploy: runs-on: ubuntu-latest @@ -43,7 +43,7 @@ jobs: container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }} container-registry-username: ${{ secrets.REGISTRY_USERNAME }} container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} - secret-name: alkemio-guidance-engine-secret + secret-name: alkemio-virtual-contributor-engine-guidance-secret - uses: azure/setup-kubectl@v3.2 with: @@ -55,6 +55,6 @@ jobs: manifests: | manifests/25-genai-deployment-dev.yaml images: | - ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-guidance-engine:${{ github.sha }} + ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} imagepullsecrets: | - alkemio-guidance-engine-secret + alkemio-virtual-contributor-engine-guidance-secret diff --git a/.github/workflows/build-release-docker-hub.yml b/.github/workflows/build-release-docker-hub.yml index e977ebc..e46eed2 100644 --- a/.github/workflows/build-release-docker-hub.yml +++ b/.github/workflows/build-release-docker-hub.yml @@ -13,7 +13,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=alkemio/guidance-engine + DOCKER_IMAGE=alkemio/virtual-contributor-engine-guidance VERSION=noop if [ "${{ github.event_name }}" = "schedule" ]; then VERSION=nightly diff --git a/Dockerfile b/Dockerfile index 4787d4e..be912f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,5 +42,5 @@ COPY --from=builder /root/.cache/pypoetry/virtualenvs /root/.cache/pypoetry/virt # Add Hugo and Go to the PATH ENV PATH="/usr/local/hugo:/usr/local/go/bin:${PATH}" -# Run guidance_engine.py when the container launches -CMD ["poetry", "run", "python", "guidance_engine.py"] \ No newline at end of file +# Run virtual_contributor_engine_guidance.py when the container launches +CMD ["poetry", "run", "python", "virtual_contributor_engine_guidance.py"] \ No newline at end of file diff --git a/README.md b/README.md index 5d57681..5db8691 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Training a LLM is prohibitatively expensive for most organisations, but for most ## Implementation The projects has been implemented as a container based micro-service with a RabbitMQ RPC. There is one RabbitMQ queue: -- `alkemio-chat-guidance` - queue for submitting requests to the microservice +- `alkemio-virtual-contributor-engine-guidance` - queue for submitting requests to the microservice The request payload consists of json with the following structure (example for a query): ``` @@ -56,16 +56,16 @@ There is a draft implementation for the interaction language of the model (this 'BG': 'Bulgarian', 'UA': "Ukranian" -*note: there is an earlier (outdated) RESTful implementation available at https://github.com/alkem-io/guidance-engine/tree/http-api +*note: there is an earlier (outdated) RESTful implementation available at https://github.com/alkem-io/virtual-contributor-engine-guidance/tree/http-api ### Docker The following command can be used to build the container from the Docker CLI (default architecture is amd64, so `--build-arg ARCHITECTURE=arm64` for amd64 builds): -`docker build --build-arg ARCHITECTURE=arm64 --no-cache -t alkemio/guidance-engine:v0.4.0 .` -`docker build --no-cache -t alkemio/guidance-engine:v0.2.0 .` +`docker build --build-arg ARCHITECTURE=arm64 --no-cache -t alkemio/virtual-contributor-engine-guidance:v0.4.0 .` +`docker build --no-cache -t alkemio/virtual-contributor-engine-guidance:v0.2.0 .` The Dockerfile has some self-explanatory configuration arguments. The following command can be used to start the container from the Docker CLI: -`docker run --name guidance-engine -v /dev/shm:/dev/shm --env-file .env guidance-engine` +`docker run --name virtual-contributor-engine-guidance -v /dev/shm:/dev/shm --env-file .env virtual-contributor-engine-guidance` where `.env` based on `.azure-template.env` Alternatively use `docker-compose up -d`. @@ -89,7 +89,7 @@ with: - `LANGCHAIN_TRACING_V2` : enable Langchain tracing - `LANGCHAIN_ENDPOINT` : Langchain tracing endpoint (e.g. "https://api.smith.langchain.com") - `LANGCHAIN_API_KEY` : Langchain tracing API key -- `LANGCHAIN_PROJECT` : Langchain tracing project name (e.g. "guidance-engine") +- `LANGCHAIN_PROJECT` : Langchain tracing project name (e.g. "virtual-contributor-engine-guidance") You can find sample values in `.azure-template.env`. Configure them and create `.env` file with the updated settings. @@ -97,7 +97,7 @@ You can find sample values in `.azure-template.env`. Configure them and create ` The project requires Python & Poetry installed. The minimum version dependencies can be found at `pyproject.toml`. After installing Python & Poetry: * Install the dependencies: `poetry install` -* Run using `poetry run python guidance_engine.py` +* Run using `poetry run python virtual_contributor_engine_guidance.py` ### Linux The project requires Python 3.11 as a minimum and needs Go and Hugo installed for creating a local version of the website. See Go and Hugo documentation for installation instructions (only when running outside container) diff --git a/config.py b/config.py index 9ad0ef9..e4bb3af 100644 --- a/config.py +++ b/config.py @@ -9,7 +9,7 @@ "rabbitmq_host": os.getenv('RABBITMQ_HOST'), "rabbitmq_user": os.getenv('RABBITMQ_USER'), "rabbitmq_password": os.getenv('RABBITMQ_PASSWORD'), - "rabbitmqrequestqueue": "alkemio-chat-guidance", + "rabbitmqrequestqueue": "alkemio-virtual-contributor-engine-guidance", "source_website": os.getenv('AI_SOURCE_WEBSITE'), "website_repo": os.getenv('AI_WEBSITE_REPO'), "source_website2": os.getenv('AI_SOURCE_WEBSITE2'), diff --git a/docker-compose.yaml b/docker-compose.yaml index a6f4897..6eb66df 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,26 +1,26 @@ -version: '3' +version: "3" networks: alkemio: services: - guidance-engine: - container_name: guidance-engine - volumes: - - '/dev/shm:/dev/shm' - - '~/alkemio/data:/home/alkemio/data' - env_file: - - .env - image: alkemio/guidance-engine:v0.5.1 - depends_on: - rabbitmq: - condition: "service_healthy" - networks: - - alkemio + virtual-contributor-engine-guidance: + container_name: virtual-contributor-engine-guidance + volumes: + - "/dev/shm:/dev/shm" + - "~/alkemio/data:/home/alkemio/data" + env_file: + - .env + image: alkemio/virtual-contributor-engine-guidance:v0.5.1 + depends_on: + rabbitmq: + condition: "service_healthy" + networks: + - alkemio rabbitmq: image: rabbitmq:3-management-alpine - container_name: 'rabbitmq' + container_name: "rabbitmq" healthcheck: test: rabbitmq-diagnostics check_port_connectivity interval: 30s @@ -31,4 +31,4 @@ services: - 8080:15672 networks: - - alkemio \ No newline at end of file + - alkemio diff --git a/manifests/25-genai-deployment-dev.yaml b/manifests/25-genai-deployment-dev.yaml index 9858411..2422590 100644 --- a/manifests/25-genai-deployment-dev.yaml +++ b/manifests/25-genai-deployment-dev.yaml @@ -2,23 +2,23 @@ kind: Deployment apiVersion: apps/v1 metadata: namespace: default - name: alkemio-guidance-engine-deployment + name: alkemio-virtual-contributor-engine-guidance-deployment labels: - app: alkemio-guidance-engine + app: alkemio-virtual-contributor-engine-guidance spec: replicas: 1 selector: matchLabels: - app: alkemio-guidance-engine + app: alkemio-virtual-contributor-engine-guidance template: metadata: labels: - app: alkemio-guidance-engine + app: alkemio-virtual-contributor-engine-guidance spec: containers: - - name: alkemio-guidance-engine - image: alkemio.azurecr.io/alkemio-guidance-engine:latest + - name: alkemio-virtual-contributor-engine-guidance + image: alkemio.azurecr.io/alkemio-virtual-contributor-engine-guidance:latest env: - name: RABBITMQ_HOST valueFrom: diff --git a/pyproject.toml b/pyproject.toml index b81a7af..5867e10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] -name = "guidance-engine" -version = "0.6.1" +name = "virtual-contributor-engine-guidance" +version = "0.7.0" description = "Alkemio Generative AI Guidance Engine" authors = ["Alkemio BV "] license = "EUPL-1.2" diff --git a/guidance_engine.py b/virtual_contributor_engine_guidance.py similarity index 100% rename from guidance_engine.py rename to virtual_contributor_engine_guidance.py