diff --git a/.github/workflows/ci-secret.yaml b/.github/workflows/ci-secret.yaml index 6059ac8c..eb71c63a 100644 --- a/.github/workflows/ci-secret.yaml +++ b/.github/workflows/ci-secret.yaml @@ -50,7 +50,6 @@ jobs: - name: Build Docker image run: | make docker-up - sleep 1500 # TODO: Remove this after docker-compose healthcheck timeout restored fixed. - name: Run LLM CI working-directory: evaluation run: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9a6a6bc6..5c4b0a9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,11 +30,6 @@ jobs: - name: Run formatting checks run: | make check - - name: Build Docker image + - name: Build Docker images run: | - make docker-up - sleep 1500 # TODO: Remove this after docker-compose healthcheck timeout restored fixed. - - name: Teardown - if: always() - run: | - make docker-down + docker compose build diff --git a/README.md b/README.md index 7f11db45..54385ed9 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,21 @@ git clone https://github.com/The-OpenROAD-Project/ORAssistant.git **Step 2**: Copy the `.env.example` file, and update your `.env` file with the appropriate API keys. +Modify the Docker `HEALTHCHECK_` variables based on the hardware requirements. +If you have a resource-constrained PC, try increasing `HEALTHCHECK_START_PERIOD` to a value large +enough before healthcheck begins. +For more information, please refer to this [link](https://docs.docker.com/reference/compose-file/services/#healthcheck) + ```bash cd backend cp .env.example .env ``` -**Step 3**: Start the docker container by running the following command: +**Step 3**: Start and stop the docker containers by running the following command: ```bash -docker compose up +make docker-up +make docker-down ``` #### Option 2 - Local Install diff --git a/backend/.env.example b/backend/.env.example index 1daf229f..d49e9d3b 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -38,4 +38,10 @@ BACKEND_WORKERS=4 BACKEND_URL="0.0.0.0" # Set FAST_MODE=true for fast prototyping -FAST_MODE=false \ No newline at end of file +FAST_MODE=false + +# Set healthcheck parameters +HEALTHCHECK_INTERVAL="30s" +HEALTHCHECK_TIMEOUT="10s" +HEALTHCHECK_RETRIES=5 +HEALTHCHECK_START_PERIOD="1200s" diff --git a/docker-compose.yml b/docker-compose.yml index dd9849d4..2f6e7dc1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,37 +7,25 @@ services: - "8000:8000" networks: - orassistant-network - # healthcheck: - # test: "curl -f http://localhost:8000/healthcheck || exit 1" - # interval: 30s - # timeout: 10s - # retries: 5 - # start_period: 30 s # todo: make sure that this healthcheck starts after the API in the backend is ready. + healthcheck: + test: "curl -f http://localhost:8000/healthcheck || exit 1" + interval: ${HEALTHCHECK_INTERVAL:-30s} + timeout: ${HEALTHCHECK_TIMEOUT:-10s} + retries: ${HEALTHCHECK_RETRIES:-5} + start_period: ${HEALTHCHECK_START_PERIOD:-1200s} frontend: build: context: ./frontend/nextjs-frontend + depends_on: + backend: + condition: service_healthy container_name: "frontend" ports: - "3000:3000" networks: - orassistant-network - # health-checker: - # build: ./common - # container_name: "orassistant-health-checker" - # depends_on: - # backend: - # condition: service_healthy - # networks: - # - orassistant-network - # healthcheck: - # test: "ls /app || exit 1" - # interval: 30s - # timeout: 10s - # retries: 3 - # start_period: 5s - networks: orassistant-network: driver: bridge