From d153df73602f065fe1c0a8bccab99303142271a8 Mon Sep 17 00:00:00 2001
From: popcorny <celu@infuseai.io>
Date: Tue, 18 Jun 2024 10:29:59 +0800
Subject: [PATCH] Add devcontainer

Signed-off-by: popcorny <celu@infuseai.io>
---
 .devcontainer/devcontainer.json         |  7 +++----
 .devcontainer/no-base/devcontainer.json | 28 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 .devcontainer/no-base/devcontainer.json

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 8bee77228..6a82c3433 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -7,8 +7,7 @@
         "DBT_GOOGLE_DATASET": "oso_playground",
         "DBT_GOOGLE_DEV_DATASET": "oso_playground_dev",
         "DBT_GOOGLE_KEYFILE": "/home/vscode/.config/gcloud/google-service-account.json",
-        "RECCE_CI_WORKFLOW_NAME": "OSO Recce CI",
-        "RECCE_DAILY_CI_WORKFLOW_NAME": "OSO Recce Staging CI"
+        "DEPENDENCIES_SHELL_COMMAND": "pipx install poetry && poetry install"
     },
     "customizations": {
         "vscode": {
@@ -26,7 +25,7 @@
             "onAutoForward": "openBrowser"
         }
     },
-    // "postStartCommand": "echo 'Running the Post Start Task!'; bash .devcontainer/post_start_command.sh"
-    "postStartCommand": "echo 'Running the Post Start Task!'"
+    "postStartCommand": "echo 'Running the Post Start Task!'; bash .devcontainer/post_start_command.sh"
+    // "postStartCommand": "echo 'Running the Post Start Task!'"
 
 }
\ No newline at end of file
diff --git a/.devcontainer/no-base/devcontainer.json b/.devcontainer/no-base/devcontainer.json
new file mode 100644
index 000000000..a419ddb5d
--- /dev/null
+++ b/.devcontainer/no-base/devcontainer.json
@@ -0,0 +1,28 @@
+{
+    "name": "Recce CodeSpace (No base)",
+    "image": "mcr.microsoft.com/vscode/devcontainers/python:3.11",
+    "containerEnv": {
+        "DBT_GOOGLE_PROJECT": "infuseai-dev",
+        "DBT_GOOGLE_DATASET": "oso_playground",
+        "DBT_GOOGLE_DEV_DATASET": "oso_playground_dev",
+        "DBT_GOOGLE_KEYFILE": "/home/vscode/.config/gcloud/google-service-account.json",
+    },
+    "customizations": {
+        "vscode": {
+            "settings": {
+                "terminal.integrated.shell.linux": "/bin/bash",
+                "python.terminal.activateEnvironment": true
+            }
+        },
+        "extensions": []
+        },
+    "forwardPorts": [8000],
+    "portsAttributes": {
+        "8000": {
+            "label": "Recce Server",
+            "onAutoForward": "openBrowser"
+        }
+    },
+    "postCreateCommand": "pipx install poetry && poetry install && poetry run pip install recce",
+    "postStartCommand": "mkdir -p /home/vscode/.config/gcloud && printenv GOOGLE_CLOUD_SERVICE_ACCOUNT_KEY_CONTENT > ${DBT_GOOGLE_KEYFILE} && poetry run recce server --cloud --review"
+}
\ No newline at end of file