Skip to content
Merged
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
25 changes: 23 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ This repository builds a containerized virtual desktop environment (Workspace)
### `.` - Project root
Contains files more related to the repository than the project artifact. This includes various linting configurations, the README, the LICENSE, the CODE_OF_CONDUCT and so on. Apart from this, it also contains:
- `scripts/` - Contains various scripts useful in the development and maintanence of the repository.
- [`workspaces/`](#workspaces---main-artifact-directory) - Contains files related more to the project artifact than the repository infrastructure.
- [`workspaces/`](#workspaces-main-artifact-directory) - Contains files related more to the project artifact than the repository infrastructure.


### `workspaces/` - Main artifact directory
Contains all files related to the Workspace image artifact.
- [`src/`](#workspacessrc---workspace-image-source-files) - Source files needed to build the image.
- [`src/`](#workspacessrc-workspace-image-source-files) - Source files needed to build the image.
- `test/` - Files related to testing the image.
- `Dockerfile.*` - The dockerfile(s) used in building the image. (must be linted with hadolint)

#### `workspaces/src/` - Workspace image source files
- `admin/` - Admin service for workspace service discovery (FastAPI application)
- `install/` - Files used as part of the image build process.
- `resources/` - Static files injected into the image during building.
- `startup/` - Files used during image startup, bootstrapping the workspace, configuring it dependent on container runtime environment variables.
Expand Down Expand Up @@ -62,6 +63,13 @@ Contains files needed to test the integration of the workspace into existing DTa
- Include docstrings for functions and modules
- Use type hints where appropriate

#### Python Projects (admin service)
- Use Poetry for dependency management
- Run tests with pytest before committing
- Maintain test coverage above 75%
- Ensure all tests pass: `poetry run pytest --cov`
- Lint with pylint: `poetry run pylint src tests`

#### Dockerfile
- Use hadolint for linting
- Pin specific versions for base images and packages
Expand Down Expand Up @@ -102,6 +110,14 @@ Before committing changes:
4. Update Dockerfile to call the installation script
5. Update README.md with component information

#### Modifying the Admin Service
1. Make changes to `workspaces/src/admin/src/admin/`
2. Update tests in `workspaces/src/admin/tests/`
3. Run tests: `cd workspaces/src/admin && poetry run pytest --cov`
4. Run linting: `poetry run pylint src/admin tests`
5. Update documentation in README.md and DOCUMENTATION.md
6. Rebuild and reinstall: `poetry build && poetry install`

#### Modifying Startup Behavior
1. Edit or add scripts in `workspaces/src/startup/``
2. Ensure scripts are executable
Expand All @@ -128,6 +144,11 @@ docker compose -f workspaces/test/dtaas/compose.traefik.secure.tls.yaml config
# Python scripts (if any)
pylint **/*.py
flake8 **/*.py

# Admin service (Python FastAPI project)
cd workspaces/src/admin
poetry run pytest --cov=admin --cov-report=term-missing
poetry run pylint src/admin tests
```

## Best Practices
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/workspace-admin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Workspace Admin Service

on:
push:
paths:
- 'workspaces/src/admin/**'
- '.github/workflows/workspace-admin.yml'
pull_request:
paths:
- 'workspaces/src/admin/**'
- '.github/workflows/workspace-admin.yml'
workflow_dispatch:

jobs:
test-and-build:
name: Test and Build Workspace Admin
runs-on: ubuntu-latest
permissions:
contents: read # Required for checking out the code
actions: write # Required for uploading artifacts

defaults:
run:
working-directory: workspaces/src/admin

steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.12'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Verify Poetry installation
run: poetry --version

- name: Configure Poetry
run: |
poetry config virtualenvs.in-project true
poetry config virtualenvs.create true

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Run pylint (min score 9.0)
run: |
poetry run pylint src/admin tests --rcfile=${GITHUB_WORKSPACE}/.pylintrc --fail-under=9.0

- name: Run pytest with coverage
run: |
poetry run pytest --cov=admin --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
uses: codecov/codecov-action@c23a129e932ebdcb56ca1565c68c6abdbf173769
with:
files: workspaces/src/admin/coverage.xml
flags: workspace-admin-tests
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Build package
run: poetry build

- name: Upload build artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: workspace-admin
path: |
workspaces/src/admin/dist/*.whl
workspaces/src/admin/dist/*.tar.gz
retention-days: 7
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ env/
.env/
ENV/
__pycache__/
.pytest_cache/
poetry.lock

# Runtime data
pids
Expand Down Expand Up @@ -84,4 +86,10 @@ workspaces/test/dtaas/certs/**
!workspaces/test/dtaas/certs/README.md

# temp files for workspace
.workspace
.workspace

# poetry files
dist/
build/
*.egg-info/
.coverage
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,79 @@

The main changes made so far are listed here.

## Week of 10-Feb-2026

### Added
* Admin service FastAPI application with `/services` endpoint for service discovery
* CLI interface for admin service (`workspace-admin` command) with options for listing services, host, port, and reload
* Comprehensive test suite for admin service with 84% coverage (14 tests)
* Detailed documentation (DOCUMENTATION.md and README.md) for admin service

### Changed
* Admin service installation changed from poetry run to wheel package + pipx installation
* Poetry installation now uses install.python-poetry.org installer with virtualenvs configured in-project

### Fixed
* ShellCheck issues in install_admin.sh (test syntax, variable bracing, error handling)
* Docker build path from `${INST_DIR}/../../admin` to `${INST_DIR}/../admin`
* Linting issues: removed whitespace, unused imports, fixed f-strings
* Type hints for FastAPI response endpoints
* Mistakes in workspace admin installation

## Week of 03-Feb-2026

### Changed
* Workspace Docker image now published to `intocps/workspace` registry

## Week of 20-Jan-2026

### Changed
* Docker labels moved from build stage to deploy stage in Dockerfile

## Week of 13-Jan-2026

### Added
* TLS/HTTPS support with OAuth2 authentication for production deployments
* New Docker compose files for TLS configuration
* Self-signed certificate generation support
* `.gitattributes` file specifying LF line endings for all non-binary files

### Changed
* Workspace name changed from `workspace-nouveau` to `workspace`
* GitHub Actions updated to reflect new image location
* Traefik-forward-auth version updated to fix endless redirect loop bug
* Consolidated environment file setup between OAuth2 and TLS features

### Fixed
* Docker image publish problems
* Regular user set for login user

## Week of 06-Jan-2026

### Added
* Automated Docker image publishing to GHCR and Docker Hub
* OCI labels to Dockerfile for better metadata
* PUBLISHING.md documentation for Docker image publishing workflow
* CLAUDE.md file for Claude code use

### Changed
* Main image name from "workspace-nouveau" to "workspace"

## Week of 16-Dec-2025

### Added
* Traefik reverse proxy integration for multi-user deployments
* OAuth2-secured multi-user deployment with traefik-forward-auth and DTaaS web client integration
* Strict linting enforcement in GitHub Actions workflows
* New project structure with dedicated DTaaS testing directory
* Configuration and certificates organization in dedicated DTaaS directory

### Fixed
* Resolved Copilot review comments from PR #10

### Changed
* Improved documentation for multi-user deployments

## 15-Dec-2025

* Adds both ml-workspace and workspace in one docker compose
Expand Down
Loading
Loading