Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab11 solution by Efim Puzhalov [email protected] + bonus #1368

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
28aea4c
feat(lab1): initial commit
Jan 25, 2025
de80aca
feat(lab1): main task completed
yeaphm Jan 25, 2025
87ae93a
feat(lab1): bonus task implementation
yeaphm Jan 25, 2025
6e59237
feat(lab1): framework changed
Jan 25, 2025
31231cb
feat(lab2): dockerfile added
yeaphm Jan 25, 2025
8ff7863
feat(lab2): main task completed
Jan 25, 2025
1253a4b
feat(lab2): docker md fixed
Jan 25, 2025
5449500
feat(lab2): multi-stage build for csharp project implemented
Jan 26, 2025
38fa4a9
feat(lab2): fixed readme
Jan 26, 2025
e9a02fe
feat(lab2): fixed readme
Jan 26, 2025
5eff659
feat(lab2): implemented distroless version for csharp project
Jan 26, 2025
6938c2f
feat(lab2): fixed docker.md
Jan 26, 2025
39d927d
feat(lab2): python distroless
Jan 26, 2025
434e708
feat(lab2): dockerhub added
Jan 26, 2025
f2606e9
feat(lab2): image comparison added
Jan 26, 2025
2d6ff69
feat(lab2): readme fixed
Jan 26, 2025
9df5337
Merge branch 'master' into lab3
Feb 2, 2025
d955fc0
feat: unit tests for python implemented
Feb 2, 2025
2b1e109
ci: pipeline implemented
Feb 2, 2025
e2cfe18
ci: fix ci first stage
Feb 2, 2025
1d4a47a
ci: fix ci
Feb 2, 2025
9f9a04c
ci: fixed by adding httpx to requirements
Feb 2, 2025
e731b3c
ci: fixed registry push
Feb 2, 2025
0c13808
ci: one more fix
Feb 2, 2025
012ef43
ci: ...
Feb 2, 2025
c102074
s bogom
Feb 2, 2025
47a1f38
pomogite
Feb 2, 2025
bb84612
ci: docs updated, python part finalized
Feb 2, 2025
426d9f6
ci: first try c# ci
Feb 2, 2025
e54ff29
ci: linter fixed
Feb 2, 2025
a198a67
ci: fix
Feb 2, 2025
dfa2c0b
ci: fix
Feb 2, 2025
c122841
ci: security fix
Feb 2, 2025
792ece0
ci: security check fix
Feb 2, 2025
53acde2
fix ci
Feb 2, 2025
bae225e
ci with dockerfile fixed
Feb 2, 2025
788c3c6
ci: dockerfile edited
Feb 2, 2025
0902e66
ci: distroless publish added
Feb 2, 2025
15b3287
ci optimization
Feb 2, 2025
e3d7438
ci fix
Feb 2, 2025
189363d
ci fix
Feb 2, 2025
1d9122f
ci leave only distroless img
Feb 2, 2025
8489e53
ci finalized
Feb 2, 2025
4a0ef9f
fix
Feb 2, 2025
4ee6da1
documentation provided
Feb 2, 2025
51a83bd
badge added
Feb 2, 2025
a4290bf
feat: terraform
Feb 4, 2025
15921df
feat: yandex + bonus
Feb 5, 2025
fd59d92
feat: doc fixed
Feb 5, 2025
a024ce0
feat: another fix
Feb 5, 2025
3740dae
Merge branch 'inno-devops-labs:master' into lab5
yeaphm Feb 9, 2025
86ffc6e
feat: ansible + bonus
Feb 9, 2025
70bcddd
feat: security fix
Feb 9, 2025
5845d57
Merge branch 'inno-devops-labs:master' into lab5
yeaphm Feb 9, 2025
a6fb64d
feat: format fix
Feb 9, 2025
d438ddc
Merge branch 'lab5' of https://github.com/yeaphm/S25-core-course-labs…
Feb 9, 2025
39e4e8d
feat(lab6): lab 6 + bonus
Feb 10, 2025
60680c7
logs(lab7): logging + BONUS
Feb 16, 2025
1c237be
fix(lab7): img directory fixed
Feb 16, 2025
839f861
fix(lab7): one more fix
Feb 16, 2025
9e5640a
feat(lab8): added metrics
Feb 16, 2025
f497769
fix: linter error
Feb 16, 2025
9b29865
fix: lint
Feb 16, 2025
5cae6e3
fix: compose
Feb 16, 2025
c453cb6
lab8: metrics report
Feb 17, 2025
09e3f48
fix: number removed
Feb 17, 2025
07fc65f
lab9: complete + BONUS
Feb 23, 2025
9ae726a
lab9: img name fix
Feb 23, 2025
856f6a4
lab10: implemented + bonus
Feb 24, 2025
a7f1957
Merge pull request #13 from inno-devops-labs/master
yeaphm Mar 4, 2025
e713043
lab11: done + bonus
Mar 5, 2025
5510ee6
fixed resources
Mar 5, 2025
4efd7e6
updated
Mar 5, 2025
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
105 changes: 105 additions & 0 deletions .github/workflows/csharp_app_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: C# CI Workflow

on:
pull_request:
paths:
- 'app_csharp/**'
- '.github/workflows/csharp_app_ci.yml'

jobs:
build-test-lint:
name: Build, Lint, and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
app_csharp/MoscowTimeApp/[!bin|obj]*/
app_csharp/MoscowTimeApp.Tests/[!bin|obj]*/
key: ${{ runner.os }}-nuget-${{ hashFiles('app_csharp/MoscowTimeApp/MoscowTimeApp.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore dependencies
working-directory: app_csharp/MoscowTimeApp
run: dotnet restore

- name: Run Linter
working-directory: app_csharp/MoscowTimeApp
run: dotnet format MoscowTimeApp.sln --verify-no-changes

- name: Build and Test
working-directory: app_csharp/MoscowTimeApp
run: |
dotnet build --configuration Release --no-restore
dotnet test --configuration Release --no-build --verbosity normal

security-check:
runs-on: ubuntu-latest
needs: [build-test-lint]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
working-directory: app_csharp/MoscowTimeApp
run: dotnet restore

- name: Run Snyk Security Scan
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --file=app_csharp/MoscowTimeApp/MoscowTimeApp.sln

docker-build-push:
name: Build & Push Docker Images
runs-on: ubuntu-latest
needs: [build-test-lint, security-check]
steps:
- name: Checkout code
uses: actions/checkout@v4

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

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

- name: Build and push standard image
uses: docker/build-push-action@v5
with:
context: app_csharp
file: app_csharp/Dockerfile
tags: ${{ secrets.DOCKER_USERNAME }}/moscow-time-cs-app:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push distroless image
uses: docker/build-push-action@v5
with:
context: app_csharp
file: app_csharp/distroless.Dockerfile
tags: ${{ secrets.DOCKER_USERNAME }}/moscow-time-cs-app:distroless
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
85 changes: 85 additions & 0 deletions .github/workflows/python_app_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Python CI workflow

on:
pull_request:
paths:
- 'app_python/**'
- '.github/workflows/app_python.yml'

jobs:
build-test-lint:
name: Build, Lint, and Test
defaults:
run:
working-directory: app_python
runs-on: ubuntu-latest

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

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

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

- name: Run Linter
run: flake8 app.py test_app.py --max-line-length=88 --exclude venv

- name: Run Tests
run: pytest test_app.py -v

security-check:
runs-on: ubuntu-22.04
needs: [build-test-lint]
steps:
- uses: actions/checkout@v4
- name: Snyk Security Scan
uses: snyk/actions/python-3.10@master
with:
args: --skip-unresolved app_python/
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

docker-build-push:
name: Build & Push Docker Image
runs-on: ubuntu-latest
needs: [build-test-lint, security-check]
defaults:
run:
working-directory: app_python

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

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

- name: Build and push Alpine image
uses: docker/build-push-action@v5
with:
context: app_python
file: app_python/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/moscow-time-py-app:latest

- name: Build and push Distroless image
uses: docker/build-push-action@v5
with:
context: app_python
file: app_python/distroless.Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/moscow-time-py-app:distroless
3 changes: 3 additions & 0 deletions ansible/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fact_cache
inventory/yandex-cloud-token
plugins/inventory/__pycache__/
Loading