Skip to content

Commit d727223

Browse files
Fix issues
1 parent 5002425 commit d727223

File tree

6 files changed

+166
-349
lines changed

6 files changed

+166
-349
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ RUN --mount=type=cache,target=/home/vscode/.cache/pip,uid=1000,gid=1000 \
3636
. $VIRTUAL_ENV/bin/activate && \
3737
pip install --compile -r /tmp/requirements.txt && \
3838
pip install --compile pytest pytest-cov coverage ipykernel && \
39-
python -m ipykernel install --user --name=apim-samples --display-name="APIM Samples Python" && \
4039
pip list --format=freeze > /tmp/installed-packages.txt && \
4140
echo "✅ Pip version: $(pip --version)" > /tmp/pip-version.txt
4241

@@ -72,9 +71,6 @@ RUN --mount=type=cache,target=/var/cache/apt \
7271
# Copy the virtual environment from builder stage
7372
COPY --from=builder --chown=vscode:vscode ${VIRTUAL_ENV_PATH} ${VIRTUAL_ENV_PATH}
7473

75-
# Copy Jupyter kernel config from builder
76-
COPY --from=builder --chown=vscode:vscode /home/vscode/.local /home/vscode/.local
77-
7874
# Copy pip version info from builder
7975
COPY --from=builder /tmp/pip-version.txt /tmp/pip-version.txt
8076

.devcontainer/README.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This approach ensures:
5050
- **YAML & JSON** - Configuration file support
5151

5252
### Python Packages
53-
All packages from `requirements.txt` are pre-installed:
53+
All packages from `requirements.txt` are pre-installed in a single virtual environment:
5454
- `requests` - HTTP library
5555
- `pandas` - Data manipulation
5656
- `matplotlib` - Data visualization
@@ -60,33 +60,27 @@ All packages from `requirements.txt` are pre-installed:
6060
- `jupyter`, `ipykernel`, `notebook` - Jupyter notebook support
6161

6262
### Environment Configuration
63-
- **PYTHONPATH** - Automatically configured to include shared Python modules
64-
- **Jupyter Kernel** - Custom kernel named "APIM Samples Python"
65-
- **Azure CLI** - Installed and ready for authentication (requires tenant-specific `az login` inside container)
63+
- **Single Virtual Environment** - Located at `/home/vscode/.venv`
64+
- **Automatic .env File** - Generated with proper PYTHONPATH configuration
65+
- **VS Code Integration** - Python interpreter automatically configured
66+
- **Azure CLI** - Installed and ready for authentication
6667
- **Port Forwarding** - Common development ports (3000, 5000, 8000, 8080) pre-configured
6768

6869
## 🔧 Post-Setup Steps
6970

70-
The dev container automatically handles most setup during initialization. During the first build, you'll be prompted to configure Azure CLI authentication.
71+
The dev container automatically handles all setup during initialization. The environment is ready to use immediately after the container starts.
7172

72-
### Automated Interactive Setup (During First Build)
73-
When the container starts for the first time, the setup script will automatically:
74-
1. **Install all dependencies** (Python packages, Azure CLI extensions)
75-
2. **Configure Jupyter environment** with custom kernel
76-
3. **Prompt for Azure CLI configuration**:
77-
- Mount local Azure config (preserves login between rebuilds)
78-
- Use manual login (run tenant-specific `az login` each time)
79-
- Configure manually later
73+
### Automated Setup (Every Container Start)
74+
When the container starts, the setup script will automatically:
75+
1. **Activate the virtual environment** (single environment only)
76+
2. **Generate .env file** with proper PYTHONPATH configuration
77+
3. **Install Azure CLI extensions** (containerapp, front-door)
78+
4. **Verify all packages** are correctly installed
79+
5. **Configure VS Code workspace** settings
8080

81-
### Manual Configuration (If Needed Later)
82-
If you skipped the initial configuration or want to change it:
81+
### Manual Azure Login (When Needed)
82+
To use Azure resources, you'll need to authenticate:
8383

84-
**Interactive Setup**:
85-
```bash
86-
python .devcontainer/configure-azure-mount.py
87-
```
88-
89-
**Manual Azure Login**:
9084
```bash
9185
# Log in to your specific tenant
9286
az login --tenant <your-tenant-id-or-domain>

.devcontainer/configure-python-interpreter.py

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

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"python.testing.pytestPath": "/home/vscode/.venv/bin/pytest",
6565
"jupyter.askForKernelRestart": false,
6666
"jupyter.interactiveWindow.textEditor.executeSelection": true,
67-
"jupyter.defaultKernel": "apim-samples",
6867
"jupyter.notebookFileRoot": "${workspaceFolder}",
6968
"files.associations": {
7069
"*.bicep": "bicep"
@@ -75,7 +74,7 @@
7574
"containerEnv": {
7675
"PYTHONPATH": "/workspaces/Apim-Samples/shared/python:/workspaces/Apim-Samples"
7776
},
78-
"postStartCommand": "bash .devcontainer/post-start-light.sh",
77+
"postStartCommand": "bash .devcontainer/post-start-setup.sh",
7978
"forwardPorts": [
8079
8000,
8180
8080,

0 commit comments

Comments
 (0)