Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from DataRecce/feature/drc-451-enhancement-ref…
Browse files Browse the repository at this point in the history
…ine-the-codespace-setting

[Enhance] DRC-451 refine the codespace setting
kentwelcome authored May 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents e529c37 + 3ffe1cc commit 8d28438
Showing 6 changed files with 36 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -18,5 +18,13 @@
},
"extensions": []
},
"forwardPorts": [8000]
"forwardPorts": [8000],
"portsAttributes": {
"8000": {
"label": "Recce Server",
"onAutoForward": "openBrowser"
}
},
"postStartCommand": "echo 'Running the Post Start Task!'; bash .devcontainer/post_start_command.sh"

}
1 change: 1 addition & 0 deletions .devcontainer/github_codespace_env.sh
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ if [ "${CODESPACES}" == "true" ]; then
echo "Downloading the Recce state file for the last successful run."
gh run download $run_id --dir .recce
echo "The Recce state file is downloaded to '.recce/recce_state_file/recce_state.json'."
cp .recce/recce_state_file/recce_state.json .
fi
fi

7 changes: 7 additions & 0 deletions .devcontainer/how_to_use_codespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to run OSO (OpenSource Observer) in the GitHub Codespaces

GitHub Codespaces is a feature that allows you to develop the repository in the cloud. This is a guide on how to run the Open Source Observer repository in GitHub Codespaces directly.

## Prepare the Data Warehouse of OSO
To run the OSO repository in GitHub Codespaces, you need to prepare the data warehouse of OSO on your own GCP BigQuery. You can also follow the [Get-Stated](https://docs.opensource.observer/docs/get-started/) document on the OSO website to prepare the data warehouse.

5 changes: 2 additions & 3 deletions .devcontainer/launch_recce_server.sh
Original file line number Diff line number Diff line change
@@ -2,10 +2,9 @@

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

if [ -f "${DIR}/../.recce/recce_state_file/recce_state.json" ]; then
if [ -f "${DIR}/../recce_state.json" ]; then
echo "Launching the Recce server in review mode. The Recce state file is found."
cp ${DIR}/../.recce/recce_state_file/recce_state.json recce_state.json
recce server --review recce_state.json
recce server --review ${DIR}/../recce_state.json
else
echo "Launching the Recce server."
recce server
14 changes: 14 additions & 0 deletions .devcontainer/post_start_command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash

if [ "${CODESPACES}" == "true" ]; then
# Download github actions artifacts
bash .devcontainer/github_codespace_env.sh

# Check environment variables
bash .devcontainer/setup_required_env.sh

bash .devcontainer/prepare_dbt_manifest.sh

bash .devcontainer/launch_recce_server.sh

fi
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -27,9 +27,9 @@
"type": "shell",
"command": "bash .devcontainer/launch_recce_server.sh",
"dependsOn": ["Run DBT"],
"runOptions": {
"runOn": "folderOpen"
}
// "runOptions": {
// "runOn": "folderOpen"
// }
}
]
}

0 comments on commit 8d28438

Please sign in to comment.