Skip to content
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Goal
[Provide a clear the goal of PR]

## Changes
- [List the key changes or modifications made in the code.]
- [Highlight any significant refactoring or architectural decisions.]

## Testing
[Provide clear instructions on how to test the changes locally.]

### Checklist:
- [ ] Clear title and description
- [ ] Documentation/README updated if needed
- [ ] No secrets or large temporary files
32 changes: 32 additions & 0 deletions .github/workflows/lab3-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lab 3 CI Pipeline

on:
push:
workflow_dispatch:

jobs:
explore-github-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run a one-line script
run: echo "Hello, World! This job is running on a ${{ runner.os }} server powered by GitHub Actions!"

- name: Debug Information
run: |
echo "This job is running on: ${{ runner.os }}"
echo "The GitHub Actor who triggered it is: ${{ github.actor }}"
echo "The GitHub SHA of the commit is: ${{ github.sha }}"

- name: Gather System Information
run: |
echo "--- OS Information ---"
uname -a
echo "--- CPU Information ---"
lscpu
echo "--- Memory Information ---"
free -h
echo "--- Disk Usage ---"
df -h
Binary file added labs/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions labs/submission1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Signing commits

Signing commits is the only way to cryptographically prove that the user is the true author of his work and that it has not been changed after creation.

# Benefits of signing commits

- It is impossible to impersonate another developer
- Guarantees that the code in the commit has not been changed after its creation
- Signed commits show that the project can be trusted
212 changes: 212 additions & 0 deletions labs/submission2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
## Task 1

```bash
git cat-file -p 439bf53 # commit_hash
```
Output
```
tree dcaa1e94d50c159627af01884315276133a3d548
parent d59bfed5ef4f292af5d591d6c1883333901b8e32
author Aleliya <aleliya2005@gmail.com> 1757689894 +0300
committer Aleliya <aleliya2005@gmail.com> 1757689894 +0300
gpgsig -----BEGIN SSH SIGNATURE-----
<SSH SIGNATURE was here>
-----END SSH SIGNATURE-----

Update test1 file
```
---

```bash
git cat-file -p dcaa1e94d50c159627af01884315276133a3d548 # tree_hash
```
Output
```
040000 tree 6997d00fd149a3c2fee5d8b20c2b39ba815498f4 .github
100644 blob 4db373667a50f14a411bb5c7e879690fd08aacc1 README.md
040000 tree 61d4d824c8deb93779f2620042486ccda0cd241b labs
040000 tree 1865343f08695045014e0ed223b464e5403fca25 lectures
100644 blob c6a93f3dab646d08504b538a6ef9d44713fa030f test1.txt
```
---
```bash
git cat-file -p c6a93f3dab646d08504b538a6ef9d44713fa030f #blob_hash for test1.txt
```
Output
```
Hello World
Hello Aleliya
```


- **Blob** is the contents of a file that Git stores
- **Tree** is a folder structure that shows which files are included in a commit
- **Commit** is information about a commit: author, date, parent commit, and tree

## Task 2

I run commands below separately
```bash
git switch -c git-reset-practice
echo "First commit" > file.txt && git add file.txt && git commit -m "First commit"
echo "Second commit" >> file.txt && git add file.txt && git commit -m "Second commit"
echo "Third commit" >> file.txt && git add file.txt && git commit -m "Third commit"

git reset --soft HEAD~1 # only move the pointer one commit back, but the files remain changed

git reset --hard HEAD~1 # moves back a commit and deletes the changes

git reflog # shows the history of all actions in the git

git reset --hard 75c6e75 # restores the commit
```

After commits
```bash
git log --oneline
```
output
```
75c6e75 (HEAD -> git-reset-practice) Third commit
b512348 Second commit
60c05b2 First commit
```
After all the commands above
```bash
git reflog
```
Output
```
75c6e75 (HEAD -> git-reset-practice) HEAD@{0}: reset: moving to 75c6e75
60c05b2 HEAD@{1}: reset: moving to HEAD~1
b512348 HEAD@{2}: reset: moving to HEAD~1
75c6e75 (HEAD -> git-reset-practice) HEAD@{3}: commit: Third commit
b512348 HEAD@{4}: commit: Second commit
60c05b2 HEAD@{5}: commit: First commit
```

### What has changed with each reset:

- **git reset --soft HEAD~1** - the "Third commit" has disappeared from history, but the changes have remained prepared for the commit.

- **git reset --hard HEAD~1** - the "Second commit" disappeared from history and was completely deleted, the file returned to the state after the "First commit"

- **git reset --hard 75c6e75** - returned deleted commits, all changes were restored


## Task 3

### Snippet of graph
```bash
* 5c06f37 (side-branch) Side branch commit
* 75c6e75 (HEAD -> git-reset-practice) Third commit
* b512348 Second commit
* 60c05b2 First commit
* 439bf53 (feature/lab2) Update test1 file
* d59bfed Add test1 file
| * 45304a3 (origin/feature/lab1, feature/lab1) docs: add commit signing summary
|/
* dfc39bf (origin/main, origin/HEAD, main) docs: add PR template
* 3f80c83 feat: publish lec2
* 499f2ba feat: publish lab2
* af0da89 feat: update lab1
* 74a8c27 Publish lab1
* f0485c0 Publish lec1
```

### Commit messages list
- 5c06f37 Side branch commit
- 75c6e75 Third commit
- b512348 Second commit
- 60c05b2 First commit
- 439bf53 Update test1 file
- d59bfed Add test1 file
- 45304a3 docs: add commit signing summary
- dfc39bf docs: add PR template
- 3f80c83 feat: publish lec2
- 499f2ba feat: publish lab2
- af0da89 feat: update lab1
- 74a8c27 Publish lab1
- f0485c0 Publish lec1

The graph helps you see the structure of the branches and how they diverge from the main line.
You can immediately see which branch is located, which commits are included in it,
and how everything is connected to the main branch.


## Task 4

### The commands that I used
```bash
git tag v1.0.0 #created an tag for the current commit
git push origin v1.0.0
git tag #checked the list of tags
git show v1.0.0 #ckecked at the information about the tag
```

### Information about tag
| tag name | commit hash |
| --- | --- |
| v1.0.0 | 439bf531946cb6e9e4a669b54d1573bb391c1ab5 |


### Tags are important
- Note the stable versions of the application
- Help CI/CD systems to automatically assemble and deploy the necessary versions
- Used to create release notes and changelog
- Easily switch between project versions

## Task 5

### The commands that I used
```bash
git switch -c cmd-compare
git switch -

echo "test" > demo.txt
git status
```
Output of "git status"
```
On branch cmd-compare
```

```bash
echo "scratch" >> demo.txt
git add demo.txt
git status
```
Output of "git status"
```
On branch cmd-compare
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: demo.txt
```

```bash
git restore --staged demo.txt
git status
```
Output of "git status"
```
On branch cmd-compare
```
---
```bash
git branch
```
Output
```
* cmd-compare
feature/lab1
feature/lab2
git-reset-practice
main
side-branch
```

### When to use each command
- **git switch** - only for switching between branches and creating new branches
- **git restore** - only for working with file (undo changes, restore from commits)
- **git checkout** is an old command, best avoided
81 changes: 81 additions & 0 deletions labs/submission3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## Task 1

**Link to a successful run:**
https://github.com/Aleliya/F25-DevOps-Intro/actions/runs/17806765021

**Key concepts learned:**
- **Workflow (.yml file):** This is an automated process that you describe in the YAML file. It is located in the folder`.github/workflows/`.
- **Triggers (on: [push]):** Events that trigger workflow. In my case, any push code is sent to the repository.
- **Jobs:** A set of steps that are performed on the same runner. I have one job it is `explore-github-actions`.
- **Steps:** Individual commands or actions that are performed sequentially within a job. The steps can run scripts `run:` or use predefined actions `uses:`.
- **Runner:** A server provided by GitHub, on which jobs are performed. In my case, this is `ubuntu-latest`.

**What caused the run to trigger?**
The launch was triggered by a `push` event, namely by sending a commit with a new workflow file `lab3-ci.yml` to the 'feature/lab3` branch.

## Task 2

**Changes made to the workflow file:**
- To the `on:` block the `workflow_dispatch:` trigger has been added to enable manual triggering.
- Added a new step `Gather System Information` for task 2.
- This step uses Linux commands (`uname -a`, `lscpu`, `free -h`, `df -h`) to collect detailed information about the runner's system.

**Collected information about the system (logs from "Gather System Information"):**
```
--- OS Information ---
Linux runnervmf4ws1 6.11.0-1018-azure #18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
--- CPU Information ---
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: AuthenticAMD
Model name: AMD EPYC 7763 64-Core Processor
CPU family: 25
Model: 1
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
Stepping: 1
BogoMIPS: 4890.85
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves user_shstk clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
Virtualization: AMD-V
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 64 KiB (2 instances)
L1i cache: 64 KiB (2 instances)
L2 cache: 1 MiB (2 instances)
L3 cache: 32 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-3
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
--- Memory Information ---
total used free shared buff/cache available
Mem: 15Gi 791Mi 13Gi 39Mi 1.5Gi 14Gi
Swap: 4.0Gi 0B 4.0Gi
--- Disk Usage ---
Filesystem Size Used Avail Use% Mounted on
/dev/root 72G 46G 27G 64% /
tmpfs 7.9G 84K 7.9G 1% /dev/shm
tmpfs 3.2G 1.1M 3.2G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sdb16 881M 60M 760M 8% /boot
/dev/sdb15 105M 6.2M 99M 6% /boot/efi
/dev/sda1 74G 4.1G 66G 6% /mnt
tmpfs 1.6G 12K 1.6G 1% /run/user/1001
```
Loading