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
5 changes: 0 additions & 5 deletions .env.sample

This file was deleted.

1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ codesphere-deploy:
PLAN: 'Micro'
ON_DEMAND: 'false'
ENV: |
CS_TOKEN=$CODESPHERE_TOKEN
environment:
name: 'Preview Deployment Python MR_$CI_MERGE_REQUEST_IID'
on_stop: codesphere-teardown
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# python-demo test

before running any stage you will need to set up a 'CS_TOKEN' env var containing an Codesphere API key.
This is a Python demo application with a Streamlit frontend and FastAPI backend.

# open backend api docs

Expand Down
10 changes: 10 additions & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Main dependencies
fastapi[all]>=0.115.12
numpy>=2.3.0
pandas>=2.3.0
pytest-cov>=6.1.1
pytest-profiling>=1.8.1

# Dev dependencies (for testing and security checks)
bandit>=1.8.3
pytest>=8.4.0
52 changes: 52 additions & 0 deletions ci.DEV.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
schemaVersion: v0.2
prepare:
steps:
- name: install frontend dependencies
command: cd frontend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
- name: install backend dependencies
command: cd backend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
test:
steps:
- name: test frontend
command: cd frontend && .venv/bin/python -m pytest
- name: test backend
command: cd backend && .venv/bin/python -m pytest
- name: security check frontend
command: 'cd frontend && .venv/bin/python -m bandit -r . -c pyproject.toml
--format=custom --msg-template "{abspath}:{line}: {test_id}[{severity}]:
{msg}" -o bandit-results.txt'
- name: security check backend
command: 'cd backend && .venv/bin/python -m bandit -r . -c pyproject.toml
--format=custom --msg-template "{abspath}:{line}: {test_id}[{severity}]:
{msg}" -o bandit-results.txt'
run:
frontend:
steps:
- name: start frontend application
command: cd frontend && .venv/bin/python -m streamlit run --server.address 0.0.0.0
--server.port 3000 main.py
plan: 20
replicas: 1
isPublic: true
network:
path: /
stripPath: false
backend:
steps:
- name: start backend application
command: cd backend && .venv/bin/python -m uvicorn app:app --reload --port 3000
--host 0.0.0.0
plan: 20
replicas: 1
isPublic: false
api-docs:
steps:
- name: deploy docs
command: cd backend && .venv/bin/python -m uvicorn doc:app_docs --host 0.0.0.0
--port 3000
plan: 20
replicas: 1
isPublic: true
network:
path: /api
stripPath: false
45 changes: 45 additions & 0 deletions ci.PROD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
schemaVersion: v0.2
prepare:
steps:
- name: install frontend dependencies
command: cd frontend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
- name: install backend dependencies
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace after 'dependencies' in the comment.

Suggested change
- name: install backend dependencies
- name: install backend dependencies

Copilot uses AI. Check for mistakes.
command: cd backend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
- name: optimize python bytecode
command: cd frontend && .venv/bin/python -m compileall -b .
- name: optimize backend bytecode
command: cd backend && .venv/bin/python -m compileall -b .
test:
steps: []
run:
frontend:
steps:
- name: start frontend application
command: "cd frontend && .venv/bin/python -m streamlit run main.py --server.headless true
--server.address 0.0.0.0 --server.port 3000 --browser.gatherUsageStats
false --logger.level warning --server.enableCORS false --server.enableXsrfProtection true"
plan: 8
replicas: 2
isPublic: true
network:
path: /
stripPath: false
backend:
steps:
- name: start backend application
command: cd backend && .venv/bin/python -m uvicorn app:app --port 3000 --host 0.0.0.0
--workers 4 --worker-class uvicorn.workers.UvicornWorker --access-log --no-use-colors
plan: 8
replicas: 2
isPublic: false
api-docs:
steps:
- name: deploy docs
command: cd backend && .venv/bin/python -m uvicorn doc:app_docs --host 0.0.0.0 --port 3000
--workers 2 --access-log --no-use-colors
plan: 8
replicas: 1
isPublic: true
network:
path: /api
stripPath: false
41 changes: 41 additions & 0 deletions ci.QA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
schemaVersion: v0.2
prepare:
steps:
- name: install frontend dependencies
command: cd frontend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
- name: install backend dependencies
command: cd backend && virtualenv .venv && .venv/bin/pip install -r requirements.txt
test:
steps: []
run:
frontend:
steps:
- name: start frontend application
command: "cd frontend && .venv/bin/python -m streamlit run main.py
--server.headless true --server.address 0.0.0.0 --server.port 3000
--browser.gatherUsageStats false --logger.level info"
plan: 20
replicas: 1
isPublic: true
network:
path: /
stripPath: false
backend:
steps:
- name: start backend application
command: cd backend && .venv/bin/python -m uvicorn app:app --port 3000 --host
0.0.0.0 --workers 2
plan: 20
replicas: 1
isPublic: false
api-docs:
steps:
- name: deploy docs
command: cd backend && .venv/bin/python -m uvicorn doc:app_docs --host 0.0.0.0
--port 3000 --workers 2
plan: 20
replicas: 1
isPublic: true
network:
path: /api
stripPath: false
59 changes: 0 additions & 59 deletions ci.Qa.yml

This file was deleted.

69 changes: 0 additions & 69 deletions ci.dev.yml

This file was deleted.

55 changes: 0 additions & 55 deletions ci.prod.yml

This file was deleted.

Loading