From 3ee8a67678be59b1c3d5ca1b9965757c7abe2990 Mon Sep 17 00:00:00 2001 From: TShapinsky Date: Wed, 30 Oct 2024 19:05:23 +0000 Subject: [PATCH] add documentation for devcontainer setup --- docs/reference/developer_documentation.md | 4 ++- docs/reference/developer_quickstart.md | 31 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 docs/reference/developer_quickstart.md diff --git a/docs/reference/developer_documentation.md b/docs/reference/developer_documentation.md index fc95825f7..4ee35874b 100644 --- a/docs/reference/developer_documentation.md +++ b/docs/reference/developer_documentation.md @@ -1,5 +1,7 @@ # Developer Documentation +For developer quickstart instructions using Dev Containers see the [Developer Quickstart Guide](developer_quickstart.md) + ## Installing 1. Install prerequisites: @@ -114,4 +116,4 @@ poetry publish --build ``` docker-compose up --build ``` -3. The api can now be reached at http://localhost:5000 and the app can be reached but http://localhost:4200. \ No newline at end of file +3. The api can now be reached at http://localhost:5000 and the app can be reached but http://localhost:4200. diff --git a/docs/reference/developer_quickstart.md b/docs/reference/developer_quickstart.md new file mode 100644 index 000000000..b17b0e65d --- /dev/null +++ b/docs/reference/developer_quickstart.md @@ -0,0 +1,31 @@ +# Developer Quick Start Guide + +The fastest way to get up and running with a BuildingMOTIF developer environment is through the provided devcontainer. +The BuildingMOTIF dev container image (located at `ghcr.io/nrel/buildingmotif/devcontainer`) comes with all of the python +depencencies currently on the `develop` branch pre-installed. It also includes an install of node and angular for app +development. Additionally the container includes the Docker CLI which will attempt to interface with the docker engine +running on the host. + +## Prerequisites +1. [Docker](https://docs.docker.com/engine/install/) +2. A supporting tool like [Visual Studio Code](https://code.visualstudio.com/) or the [Dev Container CLI](https://github.com/devcontainers/cli) + +## Setup + +The following sections provide instructions on using the devcontainer with several common setups. + +All setup instructions assume you have already cloned the BuildingMOTIF repository to your local machine. + +## VS Code +1. Open the BuildingMOTIF repository in VS Code. +1. A notification will appear saying that the "Folder contains a Dev Container configuration file" +1. Click "Reopen in Container" +1. VS Code will reopen, download the container and open BuildingMOTIF inside of it + +## Dev Container CLI +1. Navigate to BuildingMOTIF +1. Start the devcontainer `devcontainer up --workspace-folder .` +1. Enter the devcontainer `devcontainer exec --workspace-folder . /bin/bash` + +## Other Tools +More information about tools that support dev containers can be found on the [Dev Containers website](https://containers.dev/supporting).