Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming (#55) #56

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-template.env
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 5 additions & 5 deletions .github/workflows/build-deploy-k8s-dev-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
with:
Expand All @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/build-deploy-k8s-sandbox-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
with:
Expand All @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/build-deploy-k8s-test-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
with:
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/build-release-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
# Run virtual_contributor_engine_guidance.py when the container launches
CMD ["poetry", "run", "python", "virtual_contributor_engine_guidance.py"]
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
```
Expand Down Expand Up @@ -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`.

Expand All @@ -89,15 +89,15 @@ 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.

### Python & Poetry
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)
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
32 changes: 16 additions & 16 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -31,4 +31,4 @@ services:
- 8080:15672

networks:
- alkemio
- alkemio
12 changes: 6 additions & 6 deletions manifests/25-genai-deployment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "EUPL-1.2"
Expand Down
File renamed without changes.
Loading