Skip to content

Commit 37b451f

Browse files
authored
Add container app scenario (#14)
1 parent 19537e2 commit 37b451f

File tree

90 files changed

+34099
-3108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+34099
-3108
lines changed

.devcontainer/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM mcr.microsoft.com/devcontainers/python:1-3.10-bullseye
2+
3+
# # Install Databricks CLI
4+
RUN curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sudo sh
5+
6+
# Copy Python dependencies
7+
COPY ./requirements.txt ./requirements.txt
8+
9+
# Install Python dependencies
10+
RUN pip install --no-cache-dir --upgrade pip && \
11+
pip install --no-cache-dir -r ./requirements.txt
12+
13+
# Install Azure ClI
14+
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash && az bicep install
15+
16+
# Connect as root non-root user. More info: https://aka.ms/dev-containers-non-root.
17+
USER vscode
18+
19+
# Add zsh-autosuggestions
20+
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
21+
RUN printf 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh\n' >> ~/.zshrc
22+
23+
# Add zsh-syntax-highlighting
24+
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
25+
RUN printf 'source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\n' >> ~/.zshrc

.devcontainer/devcontainer.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "azure-databricks-containers-mlops",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"build": {
7+
// Path is relative to the devcontainer.json file.
8+
"dockerfile": "Dockerfile"
9+
},
10+
// Features to add to the dev container. More info: https://containers.dev/features.
11+
"features": {
12+
"ghcr.io/devcontainers/features/docker-in-docker:2.10.2": {},
13+
"ghcr.io/devcontainers/features/github-cli:1": {},
14+
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {}
15+
},
16+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
17+
"forwardPorts": [
18+
5000
19+
],
20+
// Use 'postCreateCommand' to run commands after the container is created.
21+
// "postCreateCommand": "",
22+
// Configure tool-specific properties.
23+
"customizations": {
24+
"vscode": {
25+
"extensions": [
26+
"ms-azuretools.vscode-docker",
27+
"charliermarsh.ruff",
28+
"ms-vscode.vscode-node-azure-pack",
29+
"ms-vscode.azurecli",
30+
"ms-azuretools.vscode-bicep",
31+
"ms-vscode-remote.remote-containers",
32+
"databricks.databricks",
33+
"github.vscode-github-actions",
34+
"redhat.vscode-yaml"
35+
]
36+
},
37+
"settings": {
38+
"editor.autoClosingBrackets": "always",
39+
"editor.codeActionsOnSave": {
40+
"source.organizeImports": "explicit"
41+
},
42+
"editor.formatOnPaste": true,
43+
"editor.formatOnSave": true,
44+
"editor.inlineSuggest.enabled": true,
45+
"files.autoSave": "afterDelay",
46+
"git.autofetch": true,
47+
"github.copilot.enable": {
48+
"*": true
49+
},
50+
"notebook.formatOnSave.enabled": true,
51+
"notebook.codeActionsOnSave": {
52+
"notebook.source.fixAll": "explicit",
53+
"notebook.source.organizeImports": "explicit"
54+
},
55+
"terminal.integrated.defaultProfile.linux": "zsh",
56+
"terminal.integrated.profiles.linux": {
57+
"zsh": {
58+
"path": "/usr/bin/zsh"
59+
}
60+
},
61+
"[python]": {
62+
"editor.formatOnSave": true,
63+
"editor.codeActionsOnSave": {
64+
"source.fixAll": "explicit",
65+
"source.organizeImports": "explicit"
66+
},
67+
"editor.defaultFormatter": "charliermarsh.ruff"
68+
}
69+
}
70+
},
71+
// You can use the mounts property to persist the user profile (to keep things like shell history).
72+
"mounts": [
73+
"source=profile,target=/root,type=volume",
74+
"target=/root/.vscode-server,type=volume"
75+
]
76+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
77+
// "remoteUser": "root"
78+
}

.devcontainer/requirements.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# API
2+
fastapi==0.110.2
3+
uvicorn==0.29.0
4+
5+
# Model
6+
alibi-detect==0.12.0
7+
configparser==5.2.0
8+
mlflow==2.10.0
9+
psutil==5.9.0
10+
cloudpickle==2.0.0
11+
joblib==1.2.0
12+
numpy==1.23.5
13+
pandas==1.5.3
14+
scikit-learn==1.1.1
15+
typing-extensions==4.8.0

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
10+
- package-ecosystem: "devcontainers"
11+
directory: ".devcontainer/"
12+
schedule:
13+
interval: weekly
14+
15+
- package-ecosystem: "docker"
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
20+
- package-ecosystem: "github-actions"
21+
directory: "/"
22+
schedule:
23+
interval: "weekly"
24+
25+
- package-ecosystem: "python"
26+
directory: "/"
27+
schedule:
28+
interval: "weekly"

.github/docs/architecture-guide.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/docs/getting-started.md

Lines changed: 103 additions & 0 deletions
-473 KB
Binary file not shown.
-349 KB
Binary file not shown.
-512 KB
Binary file not shown.
-567 KB
Binary file not shown.

0 commit comments

Comments
 (0)