-
Notifications
You must be signed in to change notification settings - Fork 7
Configuring the Development Environment
Install Python3 3.12 from the Python downloads page.
Important
Python 3.13 has an issue with some of the dependencies (see here). You must use Python 3.12.
Linux users should install Python using their distribution's package manager.
Windows users need to enable some optional settings:
You need to turn off App Installer
from App execution aliases:
Windows users will also need to install the Visual Studio build tools from here, selecting Desktop development with C++
:
git clone https://github.com/OctopusSolutionsEngineering/OctopusCopilot.git
cd OctopusCopilot
Virtual environments provide an isolated space for project dependencies.
python3 -m venv .venv
source .venv/bin/activate
.venv/Scripts/Activate.ps1
pip3 install -r requirements.txt
Octoterra is a service used to convert Octopus resources to HCL. The HCL is then passed to an LLM as context to describe the configuration of the Octopus instance.
- Download the latest release from GitHub for your operating system, choosing the artifact that includes
_azure
in the name. For example, if your operating system is Windows, download theoctoterra_windows_amd64_azure.exe
version. - Extract the zip file
Octoterra must be run listening on port 8081. The port is determined by the environment variable FUNCTIONS_CUSTOMHANDLER_PORT
.
FUNCTIONS_CUSTOMHANDLER_PORT=8081 ./octoterra_linux_amd64_azure
FUNCTIONS_CUSTOMHANDLER_PORT=8081 ./octoterra_macos_arm64_azure
$env:FUNCTIONS_CUSTOMHANDLER_PORT=8081
./octoterra_windows_amd64_azure.exe
Octolint may also be required, depending on the prompts you create or test. Octolint is a service used to run checks against an Octopus instance. The service runs in a separate Azure function that Octopus Copilot calls when needed.
- Download the latest release from GitHub for your operating system, choosing the artifact that includes
_azure
in the name. For example, if your operating system is Windows, download theoctolint_windows_amd64_azure.exe
version. - Extract the zip file
Octoterra must be run listening on port 8082, which is determined by the environment variable FUNCTIONS_CUSTOMHANDLER_PORT
.
FUNCTIONS_CUSTOMHANDLER_PORT=8082 ./octolint_linux_amd64_azure
FUNCTIONS_CUSTOMHANDLER_PORT=8082 ./octolint_macos_arm64_azure
$env:FUNCTIONS_CUSTOMHANDLER_PORT=8082
./octolint_windows_amd64_azure.exe
There are a number of environment variables capturing secrets required to run the Copilot backend.
Octonaughts can ping @matthew.casperson in #project-github-copilot to access the shared password containing the values for these variables.
The shared password is called Octopus Copilot OpenAI
.
Linux users can place the following code snippet into /etc/environment
or ~/.profile
. macOS users can place the code in ~/.zshenv'
:
export OCTOPUS_CLI_API_KEY=API-xxxx
export OCTOPUS_CLI_SERVER=https://yourinstance.octopus.app
export OPENAI_ENDPOINT=https://xxx.openai.azure.com/
export OPENAI_API_KEY=xxx
export OPENAI_API_DEPLOYMENT=gpt4o
export APPLICATION_OCTOTERRA_URL=http://localhost:8081
export APPLICATION_OCTOLINT_URL=http://localhost:8082
Windows users should define the environment variables in System Properties.
The CLI interface is for local testing. We don't distribute the CLI for any production usage.
python3 main.py --query "Show the projects from the Default space"
python main.py --query "Show the projects from the Default space"
Enable the Black tool in Pycharm and configure it to run on save and reformat:
If you are running end-to-end tests, in addition to Octoterra above, you also need to run the Azure storage container in docker:
docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite