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
25 changes: 25 additions & 0 deletions .github/workflows/lab9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀

on: [ push, workflow_dispatch ]

jobs:
Job:
runs-on: ubuntu-latest
env:
SYS_METRICS: metrics.txt
steps:
- name: Collect metrics
run: |
printf "CPU Info\n\n" >> $SYS_METRICS
cat /proc/cpuinfo >> $SYS_METRICS
printf "Memory Info\n\n" >> $SYS_METRICS
cat /proc/meminfo >> $SYS_METRICS
printf "OS Info\n\n" >> $SYS_METRICS
cat /etc/os-release >> $SYS_METRICS
- name: Subbmit metrics
uses: actions/upload-artifact@v4
with:
name: system_metrcis_report
path: ${{ env.SYS_METRICS }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ipfs*/
Binary file added submitions/lab9/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 submitions/lab9/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 submitions/lab9/3.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 submitions/lab9/4.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 submitions/lab9/5.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 submitions/lab9/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 185 additions & 0 deletions submitions/lab9/metrics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
CPU Info

processor : 0
vendor_id : AuthenticAMD
cpu family : 25
model : 1
model name : AMD EPYC 7763 64-Core Processor
stepping : 1
microcode : 0xffffffff
cpu MHz : 2445.426
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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 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 invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso
bogomips : 4890.85
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : AuthenticAMD
cpu family : 25
model : 1
model name : AMD EPYC 7763 64-Core Processor
stepping : 1
microcode : 0xffffffff
cpu MHz : 3243.612
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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 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 invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso
bogomips : 4890.85
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management:

processor : 2
vendor_id : AuthenticAMD
cpu family : 25
model : 1
model name : AMD EPYC 7763 64-Core Processor
stepping : 1
microcode : 0xffffffff
cpu MHz : 3143.141
cache size : 512 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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 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 invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso
bogomips : 4890.85
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management:

processor : 3
vendor_id : AuthenticAMD
cpu family : 25
model : 1
model name : AMD EPYC 7763 64-Core Processor
stepping : 1
microcode : 0xffffffff
cpu MHz : 2445.426
cache size : 512 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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 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 invpcid_single vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso
bogomips : 4890.85
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management:

Memory Info

MemTotal: 16364592 kB
MemFree: 14545208 kB
MemAvailable: 15273312 kB
Buffers: 174344 kB
Cached: 623128 kB
SwapCached: 0 kB
Active: 944420 kB
Inactive: 277556 kB
Active(anon): 456992 kB
Inactive(anon): 0 kB
Active(file): 487428 kB
Inactive(file): 277556 kB
Unevictable: 47116 kB
Mlocked: 44044 kB
SwapTotal: 4194300 kB
SwapFree: 4194300 kB
Zswap: 0 kB
Zswapped: 0 kB
Dirty: 592 kB
Writeback: 0 kB
AnonPages: 462396 kB
Mapped: 359516 kB
Shmem: 23424 kB
KReclaimable: 308740 kB
Slab: 383320 kB
SReclaimable: 308740 kB
SUnreclaim: 74580 kB
KernelStack: 4128 kB
PageTables: 5268 kB
SecPageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 12376596 kB
Committed_AS: 2120404 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 36696 kB
VmallocChunk: 0 kB
Percpu: 2288 kB
HardwareCorrupted: 0 kB
AnonHugePages: 163840 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
Unaccepted: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 104384 kB
DirectMap2M: 4089856 kB
DirectMap1G: 14680064 kB
OS Info

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
107 changes: 107 additions & 0 deletions submitions/lab9/submition9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Lab9

## Task 1

1. Create basic action from the [quick start guide](https://docs.github.com/en/actions/quickstart)
- Create [yml file](../../.github/workflows/lab9.yml)
- Put the Content of example yml file provided by the guide inside
- Push changes to a new branch
- Observe
2. Observations:
- We have created an actions with the name specified in `run-name`
![alt text](1.png)
- The provided example shows the following features of github actions
- We could specify when to run the action with `on: [<action>]`
- We could define a set of jobs which are the scripts that would be run by the github with `jobs:`
- inside we could spesify the machine that would be used in order to execude the job with `runs-on: <machine>`. it could be a github machine as spesified in the example or any other runner including a self-hosted runner as spesified [here](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on)
- The Job consists of the steps, which are the commands executed sequentially
- The steps could be either a terminal commands like `- run: echo "<someText>"` or third-party actions created by github users like `- uses: actions/checkout@v4`
- The steps could have its own name defined by `- name: <step name>`
- The actions could use environment variables. it includes:
- Build-in vars: `github.repository`
- Repository vars: `vars.ASDF`, `secrets.ASDF`
- User defined vars:
```yml
env:
ASDF: <var content>
jobs:
JoB:
runs-on: ubuntu-latest
env:
ASDF1: <Another var content>
steps:
- run: echo "$ASDF $ASDF1 $ASDF2"
env:
ASDF2: <Third var:)>
```
- We could run several jobs in parallel by defining several jobs
```yml
Job1:
<job>
Job2:
<job>
```
- We could run jobs sequentially by specifying which jobs has to end before the following job
```yml
Job1:
<job>
Job2:
needs: [Job1]
<job>
```
- The result of sequential and parallel jobs ![alt text](2.png)
3. Random fact: If you use windows as a machine that executes a job, it could not run docker based actions. It makes a lot of third-party containers useless
4. Faced problems:
- in yml the spaces are important as in python :3
![alt text](3.png)

## Task 2

1. Make manual trigger for action
- add the `workflow_dispatch` trigger
```yml
on: [ push, workflow_dispatch ]
```
- And now it could be manually triggered
![alt text](4.png)
2. Collect system information
- Make a new job for metric collection
- Use all the commands that were used in Lab 7
```yml
jobs:
Job:
runs-on: ubuntu-latest
steps:
- run: cat /proc/cpuinfo
- run: cat /proc/meminfo
- run: cat /etc/os-release
```
- Result
![alt text](5.png)
- Make it prettier and upload the report with performed commands
```yml
jobs:
Job:
runs-on: ubuntu-latest
env:
SYS_METRICS: metrics.txt
steps:
- name: Collect metrics
run: |
printf "CPU Info\n\n" >> $SYS_METRICS
cat /proc/cpuinfo >> $SYS_METRICS
printf "Memory Info\n\n" >> $SYS_METRICS
cat /proc/meminfo >> $SYS_METRICS
printf "OS Info\n\n" >> $SYS_METRICS
cat /etc/os-release >> $SYS_METRICS
- name: Subbmit metrics
uses: actions/upload-artifact@v4
with:
name: system_metrics_report
path: ${{ env. SYS_METRICS }}
```
![alt text](6.png)
- As result we have a [txt file that holds all the metrics we collected](./metrics.txt)
- From the collected metrics we could say that the system uses `AMD EPYC 7763 64-Core Processor` processor. And we have access to 4 cores
- The operating system is `Ubuntu 22.04.5 LTS` as expected
- The system has `MemTotal: 16364592 kB` which is about 16 GB of RAM