diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..97a644a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,27 @@ +# Use a specific version of Python image to ensure consistency across builds +FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye + +# Combine system updates, package installations and Python upgrades into a single RUN command to reduce layers +# Also, clean up the apt cache to reduce image size +RUN sudo apt-get update && sudo apt-get install -y \ + gcc \ + cmake \ + pkg-config \ + libdbus-1-dev \ + libglib2.0-dev \ + && python -m pip install --upgrade pip \ + && sudo apt-get clean \ + && sudo rm -rf /var/lib/apt/lists/* + +# Copy requirements.txt and install the Python packages +# Install keyring-related and IPython packages in the same layer to reduce the image size and build time +COPY src/requirements.txt . +RUN pip install -r requirements.txt \ + && pip install keyrings.alt dbus-python ipython ipykernel + +# Configure the IPython kernel +RUN ipython kernel install --name "python3" --user + +# Install daily version of azd for latest changes +# See: https://github.com/Azure/azure-dev/tree/main/cli/installer#download-from-daily-builds +RUN curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --version daily diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..13eb05e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "OpenAI Assistant With Promptflow", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": { + "installBicep": true, + "extensions": "ml" + }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/azure/azure-dev/azd:latest": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "prompt-flow.prompt-flow", + "ms-azuretools.vscode-docker", + "ms-python.python", + "ms-toolsai.jupyter", + "ms-azuretools.vscode-bicep", + "rogalmic.bash-debug", + "ms-toolsai.prompty" + ] + } + } +} \ No newline at end of file diff --git a/infra/hooks/postprovision.ps1 b/infra/hooks/postprovision.ps1 old mode 100644 new mode 100755 diff --git a/infra/hooks/postprovision.sh b/infra/hooks/postprovision.sh old mode 100644 new mode 100755 diff --git a/infra/hooks/predeploy.ps1 b/infra/hooks/predeploy.ps1 old mode 100644 new mode 100755 diff --git a/infra/hooks/predeploy.sh b/infra/hooks/predeploy.sh old mode 100644 new mode 100755