Skip to content
Open

Lab17 #4272

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
f86f2af
feat: implement lab01 devops info service
sunflye Jan 27, 2026
8aa8db2
feat: add DEBUG
sunflye Jan 27, 2026
3379d9f
docs: update LAB01.md
sunflye Jan 27, 2026
27a81fa
feat: implement lab2
sunflye Feb 1, 2026
f256ccf
Merge pull request #1 from sunflye/lab1
sunflye Feb 1, 2026
dd33dae
Merge pull request #2 from sunflye/lab2
sunflye Feb 10, 2026
76a492b
ci: try ci/cd
sunflye Feb 11, 2026
98d54bd
ci: try ci/cd
sunflye Feb 11, 2026
0f6c3b6
ci: try ci/cd
sunflye Feb 11, 2026
8765be9
ci: try ci/cd
sunflye Feb 11, 2026
aeb2a47
ci: try ci/cd
sunflye Feb 11, 2026
65bd9b2
feat: without cache
sunflye Feb 11, 2026
8e401fb
feat: with cache
sunflye Feb 11, 2026
e09faa3
docs: update README.md and LAB03.md
sunflye Feb 11, 2026
0860be1
docs: update README.md and LAB03.md
sunflye Feb 11, 2026
86f4ee3
docs: update README.md and LAB03.md
sunflye Feb 11, 2026
d2d7b85
Merge pull request #3 from sunflye/lab3
sunflye Feb 16, 2026
8e19225
feat: add lab4
sunflye Feb 17, 2026
1d09c27
feat: add lab4
sunflye Feb 17, 2026
1cfa887
feat: add lab4
sunflye Feb 17, 2026
30b3271
feat: add lab4
sunflye Feb 17, 2026
1ea9918
feat: add lab4
sunflye Feb 17, 2026
3382fd9
feat: add lab4
sunflye Feb 17, 2026
43e505c
Merge pull request #4 from sunflye/lab4
sunflye Feb 24, 2026
646eded
feat: complete lab05 - ansible fundamentals
sunflye Feb 24, 2026
48138af
feat: complete lab05 - ansible fundamentals
sunflye Feb 24, 2026
070bea2
feat: complete lab05 - ansible fundamentals
sunflye Feb 24, 2026
2e7e9c5
Merge pull request #5 from sunflye/lab5
sunflye Mar 5, 2026
6539200
ci: test
sunflye Mar 5, 2026
a46f35d
ci: test
sunflye Mar 5, 2026
d6c5aeb
ci: test
sunflye Mar 5, 2026
fdc45a6
ci: test
sunflye Mar 5, 2026
48e9afd
ci: test
sunflye Mar 5, 2026
ba1e71e
ci: test
sunflye Mar 5, 2026
d9a22e4
ci: test
sunflye Mar 5, 2026
0b469d5
ci: test
sunflye Mar 5, 2026
6e88dc1
ci: test
sunflye Mar 5, 2026
6540190
docs: add lab6
sunflye Mar 5, 2026
d46c7a0
docs: add lab6
sunflye Mar 5, 2026
e6e82f3
docs: add lab6
sunflye Mar 5, 2026
af9c3db
docs: add lab6
sunflye Mar 5, 2026
f058f07
Merge pull request #6 from sunflye/lab6
sunflye Mar 11, 2026
3309224
lab7
sunflye Mar 11, 2026
98962a3
lab7
sunflye Mar 11, 2026
0bf184c
Merge pull request #7 from sunflye/lab7
sunflye Mar 16, 2026
a5d0d82
add app.py log
sunflye Mar 16, 2026
c16765c
lab8
sunflye Mar 16, 2026
08741e3
fix tests
sunflye Mar 16, 2026
97ee024
Merge pull request #8 from sunflye/lab8
sunflye Mar 19, 2026
d29c559
lab9
sunflye Mar 19, 2026
4a41b49
lab9
sunflye Mar 19, 2026
ef2c0af
lab9
sunflye Mar 19, 2026
d08e11e
lab9
sunflye Mar 19, 2026
d746d0a
Merge pull request #9 from sunflye/lab9
sunflye Mar 28, 2026
319d14c
lab10
sunflye Mar 28, 2026
b4c93e5
lab10
sunflye Mar 28, 2026
609b0dc
lab10
sunflye Mar 28, 2026
f0a1232
Merge pull request #10 from sunflye/lab10
sunflye Apr 4, 2026
1389dc0
lab11
sunflye Apr 4, 2026
600da43
Merge pull request #11 from sunflye/lab11
sunflye Apr 11, 2026
42db56a
lab12
sunflye Apr 11, 2026
0bb1c1f
lab12
sunflye Apr 11, 2026
ebf2591
lab12
sunflye Apr 11, 2026
4bd3b14
lab12
sunflye Apr 11, 2026
6b8e547
lab12
sunflye Apr 11, 2026
4760c52
Merge pull request #12 from sunflye/lab12
sunflye Apr 19, 2026
77476af
Lab 13 Task 2: ArgoCD Application manifest
sunflye Apr 19, 2026
df0701f
Lab 13 Task 2: ArgoCD Application manifest
sunflye Apr 19, 2026
2dbfbe4
Lab 13 Task 2: ArgoCD Application manifest
sunflye Apr 19, 2026
80e7dd4
Lab 13 Task 2: ArgoCD Application manifest
sunflye Apr 19, 2026
fffe318
Lab 13 Task 2: ArgoCD Application manifest
sunflye Apr 19, 2026
813e5da
Lab 13 Task 2: Scale to 5 replicas
sunflye Apr 19, 2026
848e491
fix: use unique nodePort 30081 for dev environment
sunflye Apr 19, 2026
ffaa9c3
fix: use unique nodePort 30081 for dev environment
sunflye Apr 19, 2026
497ed4f
fix: use unique nodePort 30081 for dev environment
sunflye Apr 19, 2026
88bde78
lab13
sunflye Apr 19, 2026
4a6f785
lab13
sunflye Apr 19, 2026
66b4dda
Merge pull request #13 from sunflye/lab13
sunflye Apr 19, 2026
5155573
fix: use unique nodePort 30090
sunflye Apr 19, 2026
5b758ed
canary: update image tag
sunflye Apr 19, 2026
05b5849
canary: update image tag
sunflye Apr 19, 2026
b1873ab
fix
sunflye Apr 19, 2026
2ccb4e6
fix
sunflye Apr 19, 2026
6df0905
fix
sunflye Apr 19, 2026
e5a3610
fix
sunflye Apr 19, 2026
b5572a0
fix
sunflye Apr 19, 2026
7b6753a
fix
sunflye Apr 19, 2026
0211397
fix
sunflye Apr 19, 2026
08ff235
fix
sunflye Apr 19, 2026
1166405
fix
sunflye Apr 19, 2026
6027d04
lab14
sunflye Apr 19, 2026
30b2d97
Merge pull request #14 from sunflye/lab14
sunflye May 2, 2026
1167542
lab15
sunflye May 2, 2026
ee2189a
lab15
sunflye May 2, 2026
b15e6f9
lab15
sunflye May 2, 2026
50fd878
Merge pull request #15 from sunflye/lab15
sunflye May 2, 2026
6b72833
lab16
sunflye May 2, 2026
6bae343
lab16
sunflye May 2, 2026
b30a5ec
Merge pull request #16 from sunflye/lab16
sunflye May 9, 2026
40c8c8b
lab 17 implement initial API routes for v1.0.0
sunflye May 9, 2026
0c7769b
lab17 add /edge endpoint to show request metadata
sunflye May 9, 2026
e24cda8
lab17 add vars, secrets, and KV persistence
sunflye May 9, 2026
15cc4c3
lab17
sunflye May 9, 2026
e6379f3
lab17
sunflye May 10, 2026
fb2cf4f
lab17
sunflye May 10, 2026
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
81 changes: 81 additions & 0 deletions .github/workflows/ansible-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Ansible Deployment

on:
push:
branches: [ master, main, lab6 ]
paths:
- 'ansible/**'
- '!ansible/docs/**'
- '.github/workflows/ansible-deploy.yml'
pull_request:
branches: [ master, main ]
paths:
- 'ansible/**'
- '!ansible/docs/**'

jobs:
lint:
name: Ansible Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install ansible ansible-lint

- name: Run ansible-lint
run: |
cd ansible
ansible-lint playbooks/*.yml

deploy:
name: Deploy Application
needs: lint
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install Ansible
run: pip install ansible

- name: Setup SSH key from GitHub Secret
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.VM_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true

- name: Deploy with Ansible
run: |
cd ansible
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > /tmp/vault_pass
ansible-playbook playbooks/deploy.yml \
-i inventory/hosts.ini \
--vault-password-file /tmp/vault_pass \
-u ${{ secrets.VM_USER }}
rm /tmp/vault_pass

- name: Verify Deployment
run: |
sleep 10
curl -f http://${{ secrets.VM_HOST }}:5000 || exit 1
curl -f http://${{ secrets.VM_HOST }}:5000/health || exit 1

- name: Deployment Success
run: echo "✅ Ansible deployment completed successfully"
99 changes: 99 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Python CI/CD

on:
push:
branches: [ master, lab3 ]
tags:
- 'v*'
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: 'app_python/requirements.txt'

- name: Install dependencies
working-directory: app_python
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Lint with flake8
working-directory: app_python
run: |
pip install flake8
flake8 app.py --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 app.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Run unit tests
working-directory: app_python
run: |
pytest tests/ -v --cov=app --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./app_python/coverage.xml
fail_ci_if_error: false

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --file=app_python/requirements.txt --severity-threshold=high --skip-unresolved

build-and-push:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Determine version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=$(date +%Y.%m.%d)
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Version: ${VERSION}"

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./app_python
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/devops-info-service:${{ steps.version.outputs.version }}
${{ secrets.DOCKER_USERNAME }}/devops-info-service:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
53 changes: 52 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
test
# === Python ===
__pycache__/
*.py[cod]
*.so
.Python
venv/
env/
*.egg-info/

# === Terraform ===
terraform/.terraform/
terraform/*.tfstate
terraform/*.tfstate.*
terraform/.terraform.lock.hcl
terraform/terraform.tfvars
terraform/*.tfvars
terraform/labsuser.pem

# === Pulumi ===
pulumi/venv/
pulumi/__pycache__/
pulumi/Pulumi.*.yaml

# === Ansible ===
ansible/*.retry
ansible/.vault_pass
ansible/__pycache__/
ansible/labsuser.pem
ansible/group_vars/.vault_pass

# === Secrets & Keys ===
*.pem
*.key
*.pub
.env
.vault_pass
credentials
secrets/
authorized_keys

# === IDE ===
.idea/
.vscode/
*.swp
*.swo

# === OS ===
.DS_Store
Thumbs.db

# === Logs ===
*.log
Loading