Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# Define the path to the virtualenv to work with
ARG VENV_PATH="/home/vscode/venv"

COPY requirements.txt /tmp/pip-tmp/
RUN su vscode -c "python -m venv /home/vscode/venv" \
&& su vscode -c "${VENV_PATH}/bin/pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt" \
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
# Define the path to the virtualenv to work with
ARG VENV_PATH="/home/vscode/venv"
COPY requirements.txt /tmp/pip-tmp/
RUN su vscode -c "python -m venv /home/vscode/venv" \
&& su vscode -c "${VENV_PATH}/bin/pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt" \
&& rm -rf /tmp/pip-tmp
36 changes: 18 additions & 18 deletions .devcontainer/add-notice.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Display a notice when not running in GitHub Codespaces

cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository
contains restrictions on commercial use that may impact certain organizations. See
https://aka.ms/vscode-remote/conda/miniconda

EOF

notice_script="$(cat << 'EOF'
if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt"
mkdir -p "$HOME/.config/vscode-dev-containers"
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
fi
EOF
)"

# Display a notice when not running in GitHub Codespaces
cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository
contains restrictions on commercial use that may impact certain organizations. See
https://aka.ms/vscode-remote/conda/miniconda
EOF
notice_script="$(cat << 'EOF'
if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt"
mkdir -p "$HOME/.config/vscode-dev-containers"
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
fi
EOF
)"
echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
98 changes: 49 additions & 49 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.8-bullseye",
// Options
"NODE_VERSION": "none"
}
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/home/vscode/venv/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.flake8Enabled": true
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"GitHub.copilot"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"azure-cli": "latest"
}
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.8-bullseye",
// Options
"NODE_VERSION": "none"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/home/vscode/venv/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.flake8Enabled": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"GitHub.copilot"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"azure-cli": "latest"
}
}
60 changes: 30 additions & 30 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# GitHub Action to post GitHub metrics to an Azure Function App webhook
# Required secrets
# 1. A PAT with repo rights: PAT_REPO_REPORT
# 2. The webhook endpoint url: REPORTING_ENDPOINT_URL
# 3. The webhook endpoint key: REPORTING_ENDPOINT_KEY
# 4. Reporting group/team: REPORTING_GROUP

name: "GitHub repo metrics report"

on:
schedule:
# Run this once per day, towards the end of the day for keeping the most
# recent data point most meaningful (hours are interpreted in UTC).
- cron: "0 23 * * *"
workflow_dispatch: # Allow for running this manually.

jobs:
report_metrics_job:
runs-on: ubuntu-latest
name: GitHub repo metrics report
steps:
- name: run github metrics image
id: github_metrics
uses: gloveboxes/GitHubMetricsAction@v1
with:
github_repo: ${{ github.repository }}
github_personal_access_token: ${{ secrets.REPORTING_PAT }}
reporting_endpoint_url: ${{ secrets.REPORTING_ENDPOINT_URL }}
reporting_endpoint_key: ${{ secrets.REPORTING_ENDPOINT_KEY }}
reporting_group: $${{ secrets.REPORTING_GROUP }}
# GitHub Action to post GitHub metrics to an Azure Function App webhook
# Required secrets
# 1. A PAT with repo rights: PAT_REPO_REPORT
# 2. The webhook endpoint url: REPORTING_ENDPOINT_URL
# 3. The webhook endpoint key: REPORTING_ENDPOINT_KEY
# 4. Reporting group/team: REPORTING_GROUP
name: "GitHub repo metrics report"
on:
schedule:
# Run this once per day, towards the end of the day for keeping the most
# recent data point most meaningful (hours are interpreted in UTC).
- cron: "0 23 * * *"
workflow_dispatch: # Allow for running this manually.
jobs:
report_metrics_job:
runs-on: ubuntu-latest
name: GitHub repo metrics report
steps:
- name: run github metrics image
id: github_metrics
uses: gloveboxes/GitHubMetricsAction@v1
with:
github_repo: ${{ github.repository }}
github_personal_access_token: ${{ secrets.REPORTING_PAT }}
reporting_endpoint_url: ${{ secrets.REPORTING_ENDPOINT_URL }}
reporting_endpoint_key: ${{ secrets.REPORTING_ENDPOINT_KEY }}
reporting_group: $${{ secrets.REPORTING_GROUP }}
12 changes: 6 additions & 6 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\C:\\Users\\cacaste\\Source\\Repos\\Building-a-ML-demo-with-Copilot",
"PreviewInSolutionExplorer": false
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\C:\\Users\\cacaste\\Source\\Repos\\Building-a-ML-demo-with-Copilot",
"PreviewInSolutionExplorer": false
}
Loading