From a73e1bb4198d5f44c6053a776d5b9d1ea1de01b6 Mon Sep 17 00:00:00 2001 From: mazzasaverio Date: Tue, 6 Feb 2024 16:41:52 +0100 Subject: [PATCH] UPDATE: add edpoint test --- .github/workflows/docker-image.yml | 4 ++-- Dockerfile | 15 --------------- cloudbuild.yaml | 2 +- main.py | 14 -------------- 4 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile delete mode 100644 main.py diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e5ec70c..18d6dc7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -30,8 +30,8 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v3 with: - context: ./ - file: ./Dockerfile + context: ./backend + file: ./backend/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f4c0c99..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# Use an official Python runtime with NVIDIA CUDA support -FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04 - -WORKDIR /app - -# Copy your application files -COPY . /app - -# Install Python and FastAPI dependencies -RUN apt-get update && apt-get install -y python3-pip && \ - pip3 install --no-cache-dir -r requirements.txt - -EXPOSE 8000 - -CMD uvicorn main:app --port=${PORT:-8000} --host=0.0.0.0 diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 2f0fc0a..bc145d9 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -10,7 +10,7 @@ steps: args: - "run" - "deploy" - - "pdf-processor-service" # Replace with the name of your cloud run service + - "default" # Replace with the name of your cloud run service - "--image=gcr.io/$PROJECT_ID/fastapi-cloudrun:latest" - "--region=us-central1" #Replace with your region, for example us-center1 - "--platform=managed" diff --git a/main.py b/main.py deleted file mode 100644 index 52c030d..0000000 --- a/main.py +++ /dev/null @@ -1,14 +0,0 @@ -from fastapi import FastAPI, HTTPException, status, Request -from fastapi.responses import RedirectResponse, JSONResponse - -app = FastAPI(title="Title") - - -@app.get("/") -async def root(request: Request): - return RedirectResponse(url="/docs", status_code=status.HTTP_307_TEMPORARY_REDIRECT) - - -@app.get("/metrics") -async def metrics(): - return JSONResponse(content={"message": "Metrics not implemented"})