diff --git a/.github/workflows/push-to-hub.yml b/.github/workflows/push-to-hub.yml index e4b0315d1..80e76601c 100644 --- a/.github/workflows/push-to-hub.yml +++ b/.github/workflows/push-to-hub.yml @@ -5,14 +5,48 @@ on: push: branches: - "dev" + - "main" jobs: - Build-Push-Images-To-Docker-Hub: + Build-Push-Agents-API-Image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set branch name + id: variables + run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: julepai + password: "${{ secrets.DOCKER_HUB_PASSWORD }}" + + - name: Build and push agent images + uses: docker/build-push-action@v4 + with: + context: ./agents-api + file: ./agents-api/Dockerfile + push: true + tags: julepai/agents-api:${{ steps.variables.outputs.branch_name }} + cache-from: type=gha + cache-to: type=gha,mode=max + + Build-Push-Migration-Image: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set branch name + id: variables + run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')" >> $GITHUB_OUTPUT + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -22,18 +56,107 @@ jobs: username: julepai password: "${{ secrets.DOCKER_HUB_PASSWORD }}" - - uses: KengoTODA/actions-setup-docker-compose@v1 + - name: Build and push migration image + uses: docker/build-push-action@v4 with: - version: "2.24.6" + context: ./agents-api + file: ./agents-api/Dockerfile.migration + push: true + tags: julepai/cozo-migrate:${{ steps.variables.outputs.branch_name }} + cache-from: type=gha + cache-to: type=gha,mode=max + + Build-Push-Temporal-Image: + runs-on: ubuntu-latest - - name: Build images - run: | - touch .env - docker compose build + steps: + - uses: actions/checkout@v4 + + - name: Set branch name + id: variables + run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: julepai + password: "${{ secrets.DOCKER_HUB_PASSWORD }}" + + - name: Build and push temporal image + uses: docker/build-push-action@v4 + with: + context: ./agents-api + file: ./agents-api/Dockerfile.temporal + push: true + tags: julepai/temporal:${{ steps.variables.outputs.branch_name }} + cache-from: type=gha + cache-to: type=gha,mode=max - - name: Push images - run: | - docker compose push + Build-Push-Worker-Image: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set branch name + id: variables + run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: julepai + password: "${{ secrets.DOCKER_HUB_PASSWORD }}" + + - name: Build and push worker image + uses: docker/build-push-action@v4 + with: + context: ./agents-api + file: ./agents-api/Dockerfile.worker + push: true + tags: julepai/worker:${{ steps.variables.outputs.branch_name }} + cache-from: type=gha + cache-to: type=gha,mode=max + + Build-Push-Other-Images: + runs-on: ubuntu-latest + strategy: + matrix: + service-directory: + - gateway + - memory-store + # - model-serving + + steps: + - uses: actions/checkout@v4 + + - name: Set branch name + id: variables + run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: julepai + password: "${{ secrets.DOCKER_HUB_PASSWORD }}" + + - name: Build and push images + uses: docker/build-push-action@v4 + with: + context: ./${{ matrix.service-directory }} + push: true + tags: julepai/${{ matrix.service-directory }}:${{ steps.variables.outputs.branch_name }} + cache-from: type=gha + cache-to: type=gha,mode=max concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/agents-api/docker-compose.yml b/agents-api/docker-compose.yml index 71a4bb171..d879405cc 100644 --- a/agents-api/docker-compose.yml +++ b/agents-api/docker-compose.yml @@ -1,11 +1,6 @@ name: julep-agents-api version: "3" -# TODO: figure out why this doesn't work -# include: -# - ../model-serving/docker-compose.yml -# - ../memory-store/docker-compose.yml - services: agents-api: image: julepai/agents-api:dev @@ -13,8 +8,6 @@ services: container_name: agents-api depends_on: - model-serving: - condition: service_started memory-store: condition: service_started worker: diff --git a/docker-compose.yml b/docker-compose.yml index 87132f013..f141b9252 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,8 @@ version: "3" include: - ./memory-store/docker-compose.yml - ./model-serving/docker-compose.yml - - ./agents-api/docker-compose.yml - ./gateway/docker-compose.yml + - ./agents-api/docker-compose.yml # TODO: Enable after testing # - ./monitoring/docker-compose.yml