diff --git a/config.example.env b/config.example.env index 108057993a..f84d4fdf61 100644 --- a/config.example.env +++ b/config.example.env @@ -243,3 +243,10 @@ NOTIFICATION_WEBHOOK_ON_CREATED_USER= # This is the OneUptime Server URL LLM container will use to validate requests. It should be the url where you host the server. LLM_ONEUPTIME_SERVER_URL=https://localhost + +# Copilot Environment Variables +COPILOT_ONEUPTIME_URL=http://localhost +COPILOT_ONEUPTIME_REPOSITORY_SECRET_KEY= +COPILOT_GITHUB_TOKEN= +COPILOT_GITHUB_USERNAME= +COPILOT_ONEUPTIME_LLAMA_SERVER_URL= diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 238260aa19..dd59f7aa86 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -364,7 +364,21 @@ services: driver: "local" options: max-size: "1000m" - + + copilot: + networks: + - oneuptime + restart: always + environment: + ONEUPTIME_URL: ${COPILOT_ONEUPTIME_URL} + ONEUPTIME_REPOSITORY_SECRET_KEY: ${COPILOT_ONEUPTIME_REPOSITORY_SECRET_KEY} + GITHUB_TOKEN: ${COPILOT_GITHUB_TOKEN} + GITHUB_USERNAME: ${COPILOT_GITHUB_USERNAME} + ONEUPTIME_LLAMA_SERVER_URL: ${COPILOT_ONEUPTIME_LLAMA_SERVER_URL} + logging: + driver: "local" + options: + max-size: "1000m" e2e: restart: "no" diff --git a/docker-compose.copilot.yaml b/docker-compose.copilot.yaml new file mode 100644 index 0000000000..634d8f7867 --- /dev/null +++ b/docker-compose.copilot.yaml @@ -0,0 +1,29 @@ +services: + + copilot: + volumes: + - ./Copilot:/usr/src/app + # Use node modules of the container and not host system. + # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder + - /usr/src/app/node_modules/ + - ./Common:/usr/src/Common + - ./Model:/usr/src/Model + - ./CommonServer:/usr/src/CommonServer + - ./CommonUI:/usr/src/CommonUI + - /usr/src/Common/node_modules/ + - /usr/src/CommonUI/node_modules/ + - /usr/src/CommonServer/node_modules/ + - /usr/src/Model/node_modules/ + ports: + - '9985:9229' # Debugging port. + extends: + file: ./docker-compose.base.yml + service: copilot + build: + network: host + context: . + dockerfile: ./Copilot/Dockerfile + +networks: + oneuptime: + driver: bridge \ No newline at end of file diff --git a/package.json b/package.json index 2f46a18ac1..153f8111f5 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,9 @@ "start-llm": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.llm.yml up --remove-orphans -d $npm_config_services", "build-llm": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.llm.yml build $npm_config_services", "force-build-llm": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.llm.yml build --no-cache $npm_config_services", + "start-copilot": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.copilot.yml up --remove-orphans -d $npm_config_services", + "build-copilot": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.copilot.yml build $npm_config_services", + "force-build-copilot": "npm run prerun && export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.copilot.yml build --no-cache $npm_config_services", "ps": "export $(grep -v '^#' config.env | xargs) && docker compose ps", "save-logs": "export $(grep -v '^#' config.env | xargs) && docker compose logs --tail=100000 $npm_config_services > logs.txt", "logs": "export $(grep -v '^#' config.env | xargs) && docker compose logs --tail=100 -f $npm_config_services",