From 53e89698345718f65e7878a7913b8003565dd6d4 Mon Sep 17 00:00:00 2001 From: Kobby Panford-Quainoo Date: Sat, 28 Sep 2024 01:14:02 +0200 Subject: [PATCH 1/7] Update setup_sql.md --- setup/docs/setup_sql.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/docs/setup_sql.md b/setup/docs/setup_sql.md index 1821ba99..6220bedd 100644 --- a/setup/docs/setup_sql.md +++ b/setup/docs/setup_sql.md @@ -16,8 +16,8 @@ You can create a Cloud SQL instance using the Google Cloud Console or via the co ### Using Google Cloud Console #### Create Instance 1. In the Google Cloud Console, navigate to **SQL**. -2. Click on **Create Instance**. -3. Select **PostgreSQL** (or your desired database type). +2. Click on **Create Instance**. You might have to enable Compute Engine API if not already enabled. +3. Select **PostgreSQL**. 4. Enter the instance ID, password for the default `postgres` user, and configure other settings (region, machine type, etc.). 5. Click **Create**. From cd3964b5f2381308fbd29920cd8cda1e9f4c0972 Mon Sep 17 00:00:00 2001 From: Kobby Panford-Quainoo Date: Mon, 30 Sep 2024 09:46:19 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b2a47a6..e75abd6d 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ The setup can also be run locally at http://127.0.0.1 or http://localhost. - [Application Overview](#application-overview) - [Installation](#installation) - [Usage](#usage) -3. [Contributing](#contributing) -4. [License](#license) --- @@ -54,7 +52,12 @@ This section guides you through setting up the Google Cloud infrastructure neces ```sh uvicorn setup.backend.app.main:app --reload --port ``` - +4. **Install Google Cloud SDK** + Ensure you have Google Cloud SDK installed and authenticate. + ```sh + gcloud auth login + gcloud config set project YOUR_PROJECT_ID + ``` ### Database Setup 1. **Cloud SQL Configuration**: From bfa640a041cc268d9738cde300ce5720e2f86e0b Mon Sep 17 00:00:00 2001 From: Kobby Panford-Quainoo Date: Mon, 30 Sep 2024 09:47:16 +0200 Subject: [PATCH 3/7] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e75abd6d..008a53d2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ The setup can also be run locally at http://127.0.0.1 or http://localhost. - [Cloud Run Deployment](#cloud-run-deployment) 2. [Web Hosted Application for Data Annotation](#web-hosted-application-for-data-annotation) - [Application Overview](#application-overview) - - [Installation](#installation) - [Usage](#usage) --- From 78b6dabe0e0aeecf2c245c9c607ef23f6241f962 Mon Sep 17 00:00:00 2001 From: Kobby Panford-Quainoo Date: Mon, 30 Sep 2024 09:49:14 +0200 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 008a53d2..578bdbd2 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ This section guides you through setting up the Google Cloud infrastructure neces ```sh uvicorn setup.backend.app.main:app --reload --port ``` -4. **Install Google Cloud SDK** +4. **Install Google Cloud SDK**: \ Ensure you have Google Cloud SDK installed and authenticate. ```sh gcloud auth login From 00f0a8499f3c8d8ff6864393fa82964aede4bfa3 Mon Sep 17 00:00:00 2001 From: Kobby Panford-Quainoo Date: Mon, 30 Sep 2024 09:56:30 +0200 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 578bdbd2..7a649db5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ This section guides you through setting up the Google Cloud infrastructure neces uvicorn setup.backend.app.main:app --reload --port ``` 4. **Install Google Cloud SDK**: \ - Ensure you have Google Cloud SDK installed and authenticate. + Ensure you have [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) installed and authenticate. ```sh gcloud auth login gcloud config set project YOUR_PROJECT_ID From e2b7459148167721aff877f1a863c4db26d2ef7b Mon Sep 17 00:00:00 2001 From: panford Date: Tue, 1 Oct 2024 10:59:30 +0200 Subject: [PATCH 6/7] Add setup script --- setup.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..2c8fbd80 --- /dev/null +++ b/setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Checking for all required dependencies +command -v git >/dev/null 2>&1 || { echo "Git is required. Please install Git."; exit 1; } +command -v node >/dev/null 2>&1 || { echo "Node.js is required. Please install Node.js."; exit 1; } +command -v npm >/dev/null 2>&1 || { echo "npm is required. Please install npm."; exit 1; } +command -v uvicorn >/dev/null 2>&1 || { echo "Installing Uvicorn..."; pip install uvicorn; } + +echo "Cloning the repository..." +git clone https://github.com/instadeepai/SKAInnotate.git + +echo "Navigating to the frontend directory..." +cd SKAInnotate/setup/frontend || { echo "Failed to navigate to frontend directory"; exit 1; } + +echo "Installing and building npm packages and files..." +npm install +npm run build + +cd ../.. + +# Start the FastAPI server +PORT=${1:-8800} +echo "Starting the FastAPI server on port $PORT..." +uvicorn setup.backend.app.main:app --reload --port "$PORT" & + +sleep 2 + +OS=${2:-linux} + +if [[ "$OS" == "macos" ]]; then + open "http://localhost:$PORT" +else + xdg-open "http://localhost:$PORT" +fi + +echo "Setup complete! Access the application at http://localhost:$PORT" From 0161aef2e6a154546eb328a269ae65e6fa3b831d Mon Sep 17 00:00:00 2001 From: panford Date: Tue, 1 Oct 2024 11:10:50 +0200 Subject: [PATCH 7/7] Update setup script --- setup.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 2c8fbd80..5ba8fd75 100644 --- a/setup.sh +++ b/setup.sh @@ -6,11 +6,7 @@ command -v node >/dev/null 2>&1 || { echo "Node.js is required. Please install N command -v npm >/dev/null 2>&1 || { echo "npm is required. Please install npm."; exit 1; } command -v uvicorn >/dev/null 2>&1 || { echo "Installing Uvicorn..."; pip install uvicorn; } -echo "Cloning the repository..." -git clone https://github.com/instadeepai/SKAInnotate.git - -echo "Navigating to the frontend directory..." -cd SKAInnotate/setup/frontend || { echo "Failed to navigate to frontend directory"; exit 1; } +cd setup/frontend || { echo "Failed to navigate to frontend directory"; exit 1; } echo "Installing and building npm packages and files..." npm install