diff --git a/.github/workflows/lab9.yml b/.github/workflows/lab9.yml new file mode 100644 index 0000000..f26f806 --- /dev/null +++ b/.github/workflows/lab9.yml @@ -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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e79bef --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ipfs*/ \ No newline at end of file diff --git a/submitions/lab1/1.png b/submitions/lab1/1.png new file mode 100644 index 0000000..85e719b Binary files /dev/null and b/submitions/lab1/1.png differ diff --git a/submitions/lab1/2.png b/submitions/lab1/2.png new file mode 100644 index 0000000..34ba55f Binary files /dev/null and b/submitions/lab1/2.png differ diff --git a/submitions/lab1/submition1.md b/submitions/lab1/submition1.md new file mode 100644 index 0000000..eca39d8 --- /dev/null +++ b/submitions/lab1/submition1.md @@ -0,0 +1,35 @@ +# Lab1 + +## Task 1 + +1. A brief summary explaining the benefits of signing commits. + - The main idea of signing the commits is the same as signing anything - it is done to ensure the source of data (in this case the source of the commits). It is a way to ensure that the author of changes is legitimate, ensuring the security and integrity +2. Make a signed commit + - Gen keys `ssh-keygen -t ed25519 -C ""` + - Add private key to repo + ```bash + git config user.signingkey ~/.ssh/id_ed25519 + git config commit.gpgSign true + git config gpg.format ssh + ``` + - Commit `git add . && git commit -S -m 'Remake keys with actual email'` + - Push `git push origin master` + - Result: + ![alt text](1.png) + +## Task 2 + +1. A brief summary comparing these merge strategies + - Merge commit - creates the merge commit that integrates all commits to the target branch and adds the m to the end of the history. + - **Pros**: default approach, keeps all necessary metadata + - **Cons**: create a banch of useless merge commits that introduce some mess to the repository. + - Squash and Merge - combines all the commits into one big commit that is added to the target brunch in the end. + - **Pros**: Clear repo in the end that shows the result of the repo evolution + - **Cons**: Deletes metadata about the authors of the commits, should not use the merged brunch us could mess up alot of things (by re-commiting the changes squashed in previous merge) + - Rebase and Merge: rewrites the git history as if all the commits had been committed to the target branch initially. + - **Pros**: one big, clear, linear git history (used in the Trunk approach, which is an alternative to git-flow) + - **Cons**: easy to mess up and rewrite changes that were done after + - Commit added to the target brunch without the signature + - Merge conflicts could not be resolved in a single commit (if 10 commits have conflicts you have to resolve it 10 time instead of one) +2. +![alt text](2.png) \ No newline at end of file diff --git a/submitions/lab10/submition10.md b/submitions/lab10/submition10.md new file mode 100644 index 0000000..be9a02d --- /dev/null +++ b/submitions/lab10/submition10.md @@ -0,0 +1,53 @@ +# Lab10 + +## Task 1 + +Artifact registry essentially is a server that stores all the packages that you have produced in a single place. The three most popular solutions are provided by [AWS](https://docs.aws.amazon.com/codeartifact/latest/ug/welcome.html), [GCP](https://cloud.google.com/artifact-registry/docs/overview) and [Azure](https://learn.microsoft.com/en-us/azure/devops/artifacts/?view=azure-devops). They provide a similar service and differs mostly in supported packages, CLI tools and pricing. However, all of artifacts registry mentioned support generic type of packages and could substitute each other. All the supported packages are listed down below as well as tools names. + +1. AWS - CodeArtifact + - Cargo + - Swift + - Maven + - npm + - NuGet + - Python + - Ruby + - generic +2. GCP - Artifact Registry + - Docker Images + - Go modules + - Helm charts + - Java Packages + - Python + - Apt + - RPM + - generic +3. Azure - Artifacts + - Maven + - npm + - NuGet + - Python + - dotnet + - Gradle + - Cargo + - generic + +## Task 2 + +Serverless computing is basically a way to create a backend without creating it by yourself. In all cases you outsource the infrastructure part to the third-party company. And in most cases AWS, GCP and Azure provide a set of tools in order to manage you serverless computing. Down below services and short descriptions are listed for each provider + +1. [AWS](https://aws.amazon.com/serverless/getting-started/?nc=sn&loc=2&serverless.sort-by=item.additionalFields.createdDate&serverless.sort-order=desc) + - Amazon API Gateway - Define you API + - Amazon EventBridge - Bus/Data channel between applications and AWS services + - Amazon Simple Notification Service - Backend for providing notifications, such as emails, messages/ push notifications, etc.,to the customers + - Amazon Simple Queue Service - queue for application scaling and load distribution + - AWS Fargate - Container runner + - AWS Lambda - A functions that executes custom code + - AWS Serverless Application Model - Framework for creating a serverless applications (form the documentation it is mostly a guidelines of how to use tools listed above) + - AWS Step Functions - coordinates the parts of serverless application +2. [GPC](https://cloud.google.com/serverless/?hl=en) + - Cloud Run - Container runner or it could use source based deployment for Go, Node.js, Python, Java, .NET Core, Ruby + - Cloud Run functions - API definition +3. [Azure](https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-serverless-overview) + - Azure Functions - A service that executes some scripts written in C#, Java, JavaScript, PowerShell, Python, and TypeScript + - Azure Logic Apps - A serverless application workflow configuration tool that defines which Azure functions would be used and what triggers would trigger the computing \ No newline at end of file diff --git a/submitions/lab2/1.png b/submitions/lab2/1.png new file mode 100644 index 0000000..038d3ec Binary files /dev/null and b/submitions/lab2/1.png differ diff --git a/submitions/lab2/2.png b/submitions/lab2/2.png new file mode 100644 index 0000000..4099b5d Binary files /dev/null and b/submitions/lab2/2.png differ diff --git a/submitions/lab2/3.png b/submitions/lab2/3.png new file mode 100644 index 0000000..d3dcbfe Binary files /dev/null and b/submitions/lab2/3.png differ diff --git a/submitions/lab2/4.png b/submitions/lab2/4.png new file mode 100644 index 0000000..0701d9d Binary files /dev/null and b/submitions/lab2/4.png differ diff --git a/submitions/lab2/submition2.md b/submitions/lab2/submition2.md new file mode 100644 index 0000000..cdcea3e --- /dev/null +++ b/submitions/lab2/submition2.md @@ -0,0 +1,33 @@ +# Lab2 + +## Task 1 + +1. Install docker and update the system: + ```nix + #configuration.nix + virtualisation.docker.enable = true; + users.users..extraGroups = [ ... "docker" ]; + ``` + ```bash + #/bin/bash + sudo nixos-rebuild switch + ``` +2. Pull and run container: + ```bash + docker run -d --name ipfs_host -v ./submitions/ipfs_export:/export -v ./submitions/ipfs_data:/data/ipfs -p 8080:8080 -p 4001:4001 -p 5001:5001 ipfs/go-ipfs + ``` + ![alt text](1.png) + +3. Upload the file: + ![alt text](2.png) + +4. get the file with [the link](https://ipfs.io/ipfs/QmZNCtCsiTmifuiveGgN7GSRoGc7JUpHEAuvDusi62GGgR) (hash **QmZNCtCsiTmifuiveGgN7GSRoGc7JUpHEAuvDusi62GGgR**) + ![alt text](3.png) + +5. Peers and bandwith + ![alt text](4.png) + +## Task 2 + +1. IPFS hash: [bafybeiczcndqwxvgv5gkam7hufozheazefkrbgnvgb6es7n3oj6qjwwj3u](http://ipfs.io/ipfs/bafybeiczcndqwxvgv5gkam7hufozheazefkrbgnvgb6es7n3oj6qjwwj3u) +2. site: [https://early-bit-deep.on-fleek.app/](https://early-bit-deep.on-fleek.app/) \ No newline at end of file diff --git a/submitions/lab3/1.png b/submitions/lab3/1.png new file mode 100644 index 0000000..c6e8d2d Binary files /dev/null and b/submitions/lab3/1.png differ diff --git a/submitions/lab3/2.png b/submitions/lab3/2.png new file mode 100644 index 0000000..57ca35e Binary files /dev/null and b/submitions/lab3/2.png differ diff --git a/submitions/lab3/submition3.md b/submitions/lab3/submition3.md new file mode 100644 index 0000000..69f3434 --- /dev/null +++ b/submitions/lab3/submition3.md @@ -0,0 +1,106 @@ +# Lab3 + +## Task 1 + +1. try `git cat-file` + ![alt text](1.png) + +## Task 2 + +1. make all commits: + - file + ``` + First commit + Second commit + Third commit + ``` + - git status + ``` + On branch master + Your branch is ahead of 'origin/master' by 3 commits. + (use "git push" to publish your local commits) + + Untracked files: + (use "git add ..." to include in what will be committed) + submitions/lab3/ + ``` +2. Make soft reset + - File + ``` + First commit + Second commit + Third commit + ``` + - git status + ``` + Your branch is ahead of 'origin/master' by 2 commits. + (use "git push" to publish your local commits) + + Changes to be committed: + (use "git restore --staged ..." to unstage) + modified: file.txt + + Untracked files: + (use "git add ..." to include in what will be committed) + submitions/lab3/ + ``` +3. Make hard reset + - File + ``` + First commit + ``` + - git status + ``` + On branch master + Your branch is ahead of 'origin/master' by 1 commit. + (use "git push" to publish your local commits) + + Untracked files: + (use "git add ..." to include in what will be committed) + submitions/lab3/ + ``` +4. make mixed reset (default) + - File + ``` + First commit + ``` + - Git status + ``` + On branch master + Your branch is up to date with 'origin/master'. + + Untracked files: + (use "git add ..." to include in what will be committed) + file.txt + submitions/lab3/ + + nothing added to commit but untracked files present (use "git add" to track) + ``` +5. `git reflog` (yes it took me 3 attempts) +![alt text](2.png) + +6. `git reset --hard ` + - file + ``` + First commit + Second commit + Third commit + ``` + - git status + ``` + On branch master + Your branch is ahead of 'origin/master' by 3 commits. + (use "git push" to publish your local commits) + + Untracked files: + (use "git add ..." to include in what will be committed) + submitions/lab3/ + ``` +7. Explonation + - `git reset`: based on experience, use cases `reset` moves the head between the different commits according to the selected mode. From "GIT-RESET(1)" man and based on the output of file/git status, the modes work as follows: + - **soft**: just relocate the HEAD with no changes to git storage (index) or local fs (tree) + - **mixed** (default): move head to the target commit and update git storage (index) without updating the local fs (tree) + - **hard**: move the head to the target commit and update both fit storage (index) and local fs (tree) + - `git reflog`: this is the log changes of the current branch hash as it logs all the commits, resets, checkouts, and rebases (if it were only commits and resets, I could have assumed it was a log of all HEAD changes). + - `HEAD~` commit relative to the head down (e.g. `HEAD~/HEAD~1` - 1 commit before head, `HEAD~10` 10 commits before head) +8. Hard reset to HEAD~3 (don't want to keep trash in the repo :)) \ No newline at end of file diff --git a/submitions/lab4/1.png b/submitions/lab4/1.png new file mode 100644 index 0000000..13b94bd Binary files /dev/null and b/submitions/lab4/1.png differ diff --git a/submitions/lab4/2.png b/submitions/lab4/2.png new file mode 100644 index 0000000..a62c203 Binary files /dev/null and b/submitions/lab4/2.png differ diff --git a/submitions/lab4/3.png b/submitions/lab4/3.png new file mode 100644 index 0000000..053e1bc Binary files /dev/null and b/submitions/lab4/3.png differ diff --git a/submitions/lab4/4.png b/submitions/lab4/4.png new file mode 100644 index 0000000..02f40bd Binary files /dev/null and b/submitions/lab4/4.png differ diff --git a/submitions/lab4/5.png b/submitions/lab4/5.png new file mode 100644 index 0000000..7e19518 Binary files /dev/null and b/submitions/lab4/5.png differ diff --git a/submitions/lab4/6.png b/submitions/lab4/6.png new file mode 100644 index 0000000..bd73ee5 Binary files /dev/null and b/submitions/lab4/6.png differ diff --git a/submitions/lab4/7.png b/submitions/lab4/7.png new file mode 100644 index 0000000..0f2a4b3 Binary files /dev/null and b/submitions/lab4/7.png differ diff --git a/submitions/lab4/submition4.md b/submitions/lab4/submition4.md new file mode 100644 index 0000000..c9302a5 --- /dev/null +++ b/submitions/lab4/submition4.md @@ -0,0 +1,97 @@ +# Lab4 + +## Note from personal hands-on experience + + - Pacman is mach faster than the apt since it is just faster by itself and allows for parrallel download since recently (before powerpill was used, and I'm not sure about parralel download in apt) + - Pacman is more convenient (maybe just a preference), especially since AUR package managers, such as yay and paru, provide very convenient package locations (they have search) + - So the arch/manjaro would be the distribution to install :-) if it were stable + - As a result, I end up using NixOS since it is something new and exotic :) + - Due to I refusal to use ubuntu/debian this lab was done in a Docker container + +## Task 1 + +1. Run the container with ubuntu + ```bash + docker run -it --name=devopsLab-v./submitions/lab4/ubuntuVol:/labmaterials--entrypoint/bin/bashubuntu + ``` +2. if required, you could access the container with `docker start -ai devopsLab` +3. Install dpkg-dev + ```bash + apt update + apt-get install dpkg-dev + ``` +4. Generate a package index: + ```bash + dpkg-scanpackages ./ /dev/null | gzip-9c > ./Packages.gz + ``` +5. Update package name with vim: + ``` + # zcat Packages.gz + Package: my-vs-code + Version: 1.91.1-1720564633 + Architecture: amd64 + Maintainer: Microsoft Corporation + Installed-Size: 388720 + Depends: ca-certificates, libasound2 (>= 1.0.17), libatk-bridge2.0-0 (>= 2.5.3), libatk1.0-0 (>= 2.2.0), libatspi2.0-0 (>= 2.9.90), libc6 (>= 2.14), libc6 (>= 2.16), libc6 (>= 2.17), libc6 (>= 2.2.5), libc6 (>= 2.28), libcairo2 (>= 1.6.0), libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3, libdbus-1-3 (>= 1.9.14), libdrm2 (>= 2.4.75), libexpat1 (>= 2.1~beta3), libgbm1 (>= 17.1.0~rc2), libglib2.0-0 (>= 2.37.3), libgssapi-krb5-2 (>= 1.17), libgtk-3-0 (>= 3.9.10), libgtk-3-0 (>= 3.9.10) | libgtk-4-1, libkrb5-3 (>= 1.6.dfsg.2), libnspr4 (>= 2:4.9-2~), libnss3 (>= 2:3.30), libnss3 (>= 3.26), libpango-1.0-0 (>= 1.14.0), libx11-6, libx11-6 (>= 2:1.4.99.1), libxcb1 (>= 1.9.2), libxcomposite1 (>= 1:0.4.4-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxkbcommon0 (>= 0.5.0), libxkbfile1 (>= 1:1.1.0), libxrandr2, xdg-utils (>= 1.0.2) + Recommends: libvulkan1 + Conflicts: visual-studio-code + Replaces: visual-studio-code + Provides: visual-studio-code + Filename: ./code_1.91.1-1720564633_amd64.deb + Size: 100924046 + MD5sum: 04821bd56f47d5fbe8bf8f621e791437 + SHA1: 48d095107eeb17f256952d7a7c0bfb2045d3221d + SHA256: 31a13c05295f3349d3dc168d9c67dda4fcf30823fe3c34f215f0324d197f5479 + Section: devel + Priority: optional + Homepage: https://code.visualstudio.com/ + Description: Code editing. Redefined. + Visual Studio Code is a new choice of tool that combines the simplicity of + a code editor with what developers need for the core edit-build-debug cycle. + See https://code.visualstudio.com/docs/setup/linux for installation + instructions and FAQ. + ``` +6. Add repo to the source list + ```bash + echo "deb [trusted=yes] file:/labmaterials ./" | tee/etc/apt/sources.list.d/local-apt-repo.list + sudo apt update + ``` + + ![alt text](1.png) + +7. verify package exist + + ![alt text](2.png) + +8. Install package with `apt install my-vs-code` + + ![alt text](3.png) + +## Task 2 + +1. Use `apt-cache showpkg my-vs-code` + - It provides all the dependancies for vscode, as well as reverse dependancies (no in case of vscode) and providers. + + ![alt text](4.png) + +2. simulate installation with the `-s` flag + - It provides information about the current state of the package in a system and what packages would be affected by the installation process (in the case of a custom pkg re-installation would yelld removal of code pkg and the installation of the "my-vs-code" pkg) + + ![alt text](5.png) + + - it is actually the same as if you try to install a package and say "no" when apt ask you to proceed with installation. + + ![alt text](6.png) + +## Task 3 + +1. hold the code pkg with `apt-mark hold code` +2. try to reinstall "code" with "my-vs-code" + - the result is an error due to held pkg + ``` + Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. + ``` +3. unhold "code" pkg + - the installation of "my-vs-code" did not yelld an exeption anymore + + ![alt text](7.png) \ No newline at end of file diff --git a/submitions/lab4/ubuntuVol/Packages.gz b/submitions/lab4/ubuntuVol/Packages.gz new file mode 100644 index 0000000..31825f1 Binary files /dev/null and b/submitions/lab4/ubuntuVol/Packages.gz differ diff --git a/submitions/lab4/ubuntuVol/code_1.91.1-1720564633_amd64.deb b/submitions/lab4/ubuntuVol/code_1.91.1-1720564633_amd64.deb new file mode 100644 index 0000000..88455f5 Binary files /dev/null and b/submitions/lab4/ubuntuVol/code_1.91.1-1720564633_amd64.deb differ diff --git a/submitions/lab5/1.png b/submitions/lab5/1.png new file mode 100644 index 0000000..fa81512 Binary files /dev/null and b/submitions/lab5/1.png differ diff --git a/submitions/lab5/2.png b/submitions/lab5/2.png new file mode 100644 index 0000000..4284a42 Binary files /dev/null and b/submitions/lab5/2.png differ diff --git a/submitions/lab5/3.png b/submitions/lab5/3.png new file mode 100644 index 0000000..e74faba Binary files /dev/null and b/submitions/lab5/3.png differ diff --git a/submitions/lab5/4.png b/submitions/lab5/4.png new file mode 100644 index 0000000..5e72ec7 Binary files /dev/null and b/submitions/lab5/4.png differ diff --git a/submitions/lab5/5.png b/submitions/lab5/5.png new file mode 100644 index 0000000..1e00f4c Binary files /dev/null and b/submitions/lab5/5.png differ diff --git a/submitions/lab5/6.png b/submitions/lab5/6.png new file mode 100644 index 0000000..0d0ec7c Binary files /dev/null and b/submitions/lab5/6.png differ diff --git a/submitions/lab5/7.png b/submitions/lab5/7.png new file mode 100644 index 0000000..3b1314f Binary files /dev/null and b/submitions/lab5/7.png differ diff --git a/submitions/lab5/submition5.md b/submitions/lab5/submition5.md new file mode 100644 index 0000000..4a98fbc --- /dev/null +++ b/submitions/lab5/submition5.md @@ -0,0 +1,43 @@ +# Lab5 + +## Task 1 + +1. install htop and iostat (cause who needs it by default in their linux :)) + + ```nix + # configuration.nix + environment.systemPackages = with pkgs; [ + ... + # lab5 + htop + sysstat + ]; + ``` + - by the way there are nice graphs for personal linux :) (swap was never configured, that is why in mem usage second graph shows nan) + + ![alt text](2.png) ![alt text](3.png) ![alt text](4.png) + +2. `htop` ![alt text](1.png) + - sort with "f6" + - top CPU utilisation: wayland, htop, chrome + - top MEM utilization: chrome, plasma, vscode (a lot of processe for each app) + - top IO utilisation: chrome, vscode (none of other apps used IO at all in a minute) +3. `iostat` + + ![alt text](5.png) + +4. `df` + + ![alt text](6.png) + +5. `du` + + ![alt text](7.png) + + - top 3 most havy directories in `/var`: docker, journal, sddm + - Im not going deeper then 2, and I did not found sort flag in `du` so thats it) + - note from expiriance: `du` prove quite useful to locate useless files in a system when I had to free some space + +## Task 2 + +1. All the staff related to terraform could be found [here](./terraform/terraform.md) \ No newline at end of file diff --git a/submitions/lab5/terraform/.terraform.lock.hcl b/submitions/lab5/terraform/.terraform.lock.hcl new file mode 100644 index 0000000..ba2fec7 --- /dev/null +++ b/submitions/lab5/terraform/.terraform.lock.hcl @@ -0,0 +1,10 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "~> 3.0.1" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + ] +} diff --git a/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/CHANGELOG.md b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/CHANGELOG.md new file mode 100644 index 0000000..37dbb71 --- /dev/null +++ b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/CHANGELOG.md @@ -0,0 +1,655 @@ + + +## [v3.0.2](https://github.com/kreuzwerker/terraform-provider-docker/compare/v3.0.1...v3.0.2) (2023-03-17) + +### Docs + +* correct spelling of "networks_advanced" ([#517](https://github.com/kreuzwerker/terraform-provider-docker/issues/517)) + +### Fix + +* Implement proxy support. ([#529](https://github.com/kreuzwerker/terraform-provider-docker/issues/529)) + + + +## [v3.0.1](https://github.com/kreuzwerker/terraform-provider-docker/compare/v3.0.0...v3.0.1) (2023-01-13) + +### Chore + +* Prepare release v3.0.1 + +### Fix + +* Access health of container correctly. ([#506](https://github.com/kreuzwerker/terraform-provider-docker/issues/506)) + + + +## [v3.0.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.25.0...v3.0.0) (2023-01-13) + +### Chore + +* Prepare release v3.0.0 + +### Docs + +* Update documentation. +* Add migration guide and update README ([#502](https://github.com/kreuzwerker/terraform-provider-docker/issues/502)) + +### Feat + +* Prepare v3 release ([#503](https://github.com/kreuzwerker/terraform-provider-docker/issues/503)) + + + +## [v2.25.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.24.0...v2.25.0) (2023-01-05) + +### Chore + +* Prepare release v2.25.0 + +### Docs + +* Add documentation of remote hosts. ([#498](https://github.com/kreuzwerker/terraform-provider-docker/issues/498)) + +### Feat + +* Migrate build block to `docker_image` ([#501](https://github.com/kreuzwerker/terraform-provider-docker/issues/501)) +* Add platform attribute to docker_image resource ([#500](https://github.com/kreuzwerker/terraform-provider-docker/issues/500)) +* Add sysctl implementation to container of docker_service. ([#499](https://github.com/kreuzwerker/terraform-provider-docker/issues/499)) + + + +## [v2.24.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.23.1...v2.24.0) (2022-12-23) + +### Chore + +* Prepare release v2.24.0 + +### Docs + +* Fix generated website. +* Update command typo ([#487](https://github.com/kreuzwerker/terraform-provider-docker/issues/487)) + +### Feat + +* cgroupns support ([#497](https://github.com/kreuzwerker/terraform-provider-docker/issues/497)) +* Add triggers attribute to docker_registry_image ([#496](https://github.com/kreuzwerker/terraform-provider-docker/issues/496)) +* Support registries with disabled auth ([#494](https://github.com/kreuzwerker/terraform-provider-docker/issues/494)) +* add IPAM options block for docker networks ([#491](https://github.com/kreuzwerker/terraform-provider-docker/issues/491)) + +### Fix + +* Pin data source specific tag test to older tag. + +### Tests + +* Add test for parsing auth headers. + + + +## [v2.23.1](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.23.0...v2.23.1) (2022-11-23) + +### Chore + +* Prepare release v2.23.1 + +### Fix + +* Update shasum of busybox:1.35.0 tag in test. +* Handle Auth Header Scopes ([#482](https://github.com/kreuzwerker/terraform-provider-docker/issues/482)) +* Set OS_ARCH from GOHOSTOS and GOHOSTARCH ([#477](https://github.com/kreuzwerker/terraform-provider-docker/issues/477)) + + + +## [v2.23.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.22.0...v2.23.0) (2022-11-02) + +### Chore + +* Prepare release v2.23.0 + +### Feat + +* wait container healthy state ([#467](https://github.com/kreuzwerker/terraform-provider-docker/issues/467)) +* add docker logs data source ([#471](https://github.com/kreuzwerker/terraform-provider-docker/issues/471)) + +### Fix + +* Update shasum of busybox:1.35.0 tag in test. +* Update shasum of busybox:1.35.0 tag +* Correct provider name to match the public registry ([#462](https://github.com/kreuzwerker/terraform-provider-docker/issues/462)) + + + +## [v2.22.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.21.0...v2.22.0) (2022-09-20) + +### Chore + +* Prepare release v2.22.0 + +### Feat + +* Configurable timeout for docker_container resource stateChangeConf ([#454](https://github.com/kreuzwerker/terraform-provider-docker/issues/454)) + +### Fix + +* oauth authorization support for azurecr ([#451](https://github.com/kreuzwerker/terraform-provider-docker/issues/451)) + + + +## [v2.21.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.20.3...v2.21.0) (2022-09-05) + +### Chore + +* Prepare release v2.21.0 + +### Docs + +* Fix docker config example. + +### Feat + +* Add image_id attribute to docker_image resource. ([#450](https://github.com/kreuzwerker/terraform-provider-docker/issues/450)) +* Update used goversion to 1.18. ([#449](https://github.com/kreuzwerker/terraform-provider-docker/issues/449)) + +### Fix + +* Replace deprecated .latest attribute with new image_id. ([#453](https://github.com/kreuzwerker/terraform-provider-docker/issues/453)) +* Remove reading part of docker_tag resource. ([#448](https://github.com/kreuzwerker/terraform-provider-docker/issues/448)) +* Fix repo_digest value for DockerImageDatasource test. + + + +## [v2.20.3](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.20.2...v2.20.3) (2022-08-31) + +### Chore + +* Prepare release v2.20.3 + +### Fix + +* Docker Registry Image data source use HEAD request to query image digest ([#433](https://github.com/kreuzwerker/terraform-provider-docker/issues/433)) +* Adding Support for Windows Paths in Bash ([#438](https://github.com/kreuzwerker/terraform-provider-docker/issues/438)) + + + +## [v2.20.2](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.20.1...v2.20.2) (2022-08-10) + +### Chore + +* Prepare release v2.20.2 + +### Fix + +* Check the operating system for determining the default Docker socket ([#427](https://github.com/kreuzwerker/terraform-provider-docker/issues/427)) + +### Reverts + +* fix(deps): update module github.com/golangci/golangci-lint to v1.48.0 ([#423](https://github.com/kreuzwerker/terraform-provider-docker/issues/423)) + + + +## [v2.20.1](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.20.0...v2.20.1) (2022-08-10) + +### Chore + +* Prepare release v2.20.1 +* Reduce time to setup AccTests ([#430](https://github.com/kreuzwerker/terraform-provider-docker/issues/430)) + +### Docs + +* Improve docker network usage documentation [skip-ci] + +### Feat + +* Implement triggers attribute for docker_image. ([#425](https://github.com/kreuzwerker/terraform-provider-docker/issues/425)) + +### Fix + +* Add ForceTrue to docker_image name attribute. ([#421](https://github.com/kreuzwerker/terraform-provider-docker/issues/421)) + + + +## [v2.20.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.19.0...v2.20.0) (2022-07-28) + +### Chore + +* Prepare release v2.20.0 +* Fix release targets in Makefile. + +### Feat + +* Implementation of `docker_tag` resource. ([#418](https://github.com/kreuzwerker/terraform-provider-docker/issues/418)) +* Implement support for insecure registries ([#414](https://github.com/kreuzwerker/terraform-provider-docker/issues/414)) + + + +## [v2.19.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.18.1...v2.19.0) (2022-07-15) + +### Chore + +* Prepare release v2.19.0 + +### Feat + +* Add gpu flag to docker_container resource ([#405](https://github.com/kreuzwerker/terraform-provider-docker/issues/405)) + +### Fix + +* Enable authentication to multiple registries again. ([#400](https://github.com/kreuzwerker/terraform-provider-docker/issues/400)) +* ECR authentication ([#409](https://github.com/kreuzwerker/terraform-provider-docker/issues/409)) + + + +## [v2.18.1](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.18.0...v2.18.1) (2022-07-14) + +### Chore + +* Prepare release v2.18.1 +* Automate changelog generation [skip ci] + +### Fix + +* Improve searchLocalImages error handling. ([#407](https://github.com/kreuzwerker/terraform-provider-docker/issues/407)) +* Throw errors when any part of docker config file handling goes wrong. ([#406](https://github.com/kreuzwerker/terraform-provider-docker/issues/406)) +* Enables having a Dockerfile outside the context ([#402](https://github.com/kreuzwerker/terraform-provider-docker/issues/402)) + + + +## [v2.18.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.17.0...v2.18.0) (2022-07-11) + +### Chore + +* prepare release v2.18.0 + +### Feat + +* add runtime, stop_signal and stop_timeout properties to the docker_container resource ([#364](https://github.com/kreuzwerker/terraform-provider-docker/issues/364)) + +### Fix + +* Correctly handle build files and context for docker_registry_image ([#398](https://github.com/kreuzwerker/terraform-provider-docker/issues/398)) +* Switch to proper go tools mechanism to fix website-* workflows. ([#399](https://github.com/kreuzwerker/terraform-provider-docker/issues/399)) +* compare relative paths when excluding, fixes kreuzwerker[#280](https://github.com/kreuzwerker/terraform-provider-docker/issues/280) ([#397](https://github.com/kreuzwerker/terraform-provider-docker/issues/397)) + + + +## [v2.17.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.16.0...v2.17.0) (2022-06-23) + +### Chore + +* prepare release v2.17.0 +* Exclude examples directory from renovate. +* remove the workflow to close stale issues and pull requests ([#371](https://github.com/kreuzwerker/terraform-provider-docker/issues/371)) + +### Fix + +* update go package files directly on master to fix build. +* correct authentication for ghcr.io registry([#349](https://github.com/kreuzwerker/terraform-provider-docker/issues/349)) + + + +## [v2.16.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.15.0...v2.16.0) (2022-01-24) + +### Chore + +* prepare release v2.16.0 + +### Docs + +* fix service options ([#337](https://github.com/kreuzwerker/terraform-provider-docker/issues/337)) +* update registry_image.md ([#321](https://github.com/kreuzwerker/terraform-provider-docker/issues/321)) +* fix r/registry_image truncated docs ([#304](https://github.com/kreuzwerker/terraform-provider-docker/issues/304)) + +### Feat + +* add parameter for SSH options ([#335](https://github.com/kreuzwerker/terraform-provider-docker/issues/335)) + +### Fix + +* pass container rm flag ([#322](https://github.com/kreuzwerker/terraform-provider-docker/issues/322)) +* add nil check of DriverConfig ([#315](https://github.com/kreuzwerker/terraform-provider-docker/issues/315)) +* fmt of go files for go 1.17 + + + +## [v2.15.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.14.0...v2.15.0) (2021-08-11) + +### Chore + +* prepare release v2.15.0 +* re go gets terraform-plugin-docs + +### Docs + +* corrects authentication misspell. Closes [#264](https://github.com/kreuzwerker/terraform-provider-docker/issues/264) + +### Feat + +* add container storage opts ([#258](https://github.com/kreuzwerker/terraform-provider-docker/issues/258)) + +### Fix + +* add current timestamp for file upload to container ([#259](https://github.com/kreuzwerker/terraform-provider-docker/issues/259)) + + + +## [v2.14.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.13.0...v2.14.0) (2021-07-09) + +### Chore + +* prepare release v2.14.0 + +### Docs + +* update to absolute path for registry image context ([#246](https://github.com/kreuzwerker/terraform-provider-docker/issues/246)) +* update readme with logos and subsections ([#235](https://github.com/kreuzwerker/terraform-provider-docker/issues/235)) + +### Feat + +* support terraform v1 ([#242](https://github.com/kreuzwerker/terraform-provider-docker/issues/242)) + +### Fix + +* Update the URL of the docker hub registry ([#230](https://github.com/kreuzwerker/terraform-provider-docker/issues/230)) + + + +## [v2.13.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.12.2...v2.13.0) (2021-06-22) + +### Chore + +* prepare release v2.13.0 + +### Docs + +* fix a few typos ([#216](https://github.com/kreuzwerker/terraform-provider-docker/issues/216)) +* fix typos in docker_image example usage ([#213](https://github.com/kreuzwerker/terraform-provider-docker/issues/213)) + + + +## [v2.12.2](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.12.1...v2.12.2) (2021-05-26) + +### Chore + +* prepare release v2.12.2 + + + +## [v2.12.1](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.12.0...v2.12.1) (2021-05-26) + +### Chore + +* update changelog for v2.12.1 + +### Fix + +* add service host flattener with space split ([#205](https://github.com/kreuzwerker/terraform-provider-docker/issues/205)) +* service state upgradeV2 for empty auth + + + +## [v2.12.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.11.0...v2.12.0) (2021-05-23) + +### Chore + +* update changelog for v2.12.0 +* ignore dist folder +* configure actions/stale ([#157](https://github.com/kreuzwerker/terraform-provider-docker/issues/157)) +* add the guide about Terraform Configuration in Bug Report ([#139](https://github.com/kreuzwerker/terraform-provider-docker/issues/139)) +* bump docker dependency to v20.10.5 ([#119](https://github.com/kreuzwerker/terraform-provider-docker/issues/119)) + +### Ci + +* run acceptance tests with multiple Terraform versions ([#129](https://github.com/kreuzwerker/terraform-provider-docker/issues/129)) + +### Docs + +* update for v2.12.0 +* add releasing steps +* format `Guide of Bug report` ([#159](https://github.com/kreuzwerker/terraform-provider-docker/issues/159)) +* add an example to build an image with docker_image ([#158](https://github.com/kreuzwerker/terraform-provider-docker/issues/158)) +* add a guide about writing issues to CONTRIBUTING.md ([#149](https://github.com/kreuzwerker/terraform-provider-docker/issues/149)) +* fix Github repository URL in README ([#136](https://github.com/kreuzwerker/terraform-provider-docker/issues/136)) + +### Feat + +* support darwin arm builds and golang 1.16 ([#140](https://github.com/kreuzwerker/terraform-provider-docker/issues/140)) +* migrate to terraform-sdk v2 ([#102](https://github.com/kreuzwerker/terraform-provider-docker/issues/102)) + +### Fix + +* rewriting tar header fields ([#198](https://github.com/kreuzwerker/terraform-provider-docker/issues/198)) +* test spaces for windows ([#190](https://github.com/kreuzwerker/terraform-provider-docker/issues/190)) +* replace for loops with StateChangeConf ([#182](https://github.com/kreuzwerker/terraform-provider-docker/issues/182)) +* skip sign on compile action +* assign map to rawState when it is nil to prevent panic ([#180](https://github.com/kreuzwerker/terraform-provider-docker/issues/180)) +* search local images with Docker image ID ([#151](https://github.com/kreuzwerker/terraform-provider-docker/issues/151)) +* set "ForceNew: true" to labelSchema ([#152](https://github.com/kreuzwerker/terraform-provider-docker/issues/152)) + + + +## [v2.11.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.10.0...v2.11.0) (2021-01-22) + +### Chore + +* update changelog for v2.11.0 +* updates changelog for v2.10.0 + +### Docs + +* fix legacy configuration style ([#126](https://github.com/kreuzwerker/terraform-provider-docker/issues/126)) + +### Feat + +* add properties -it (tty and stdin_opn) to docker container + + + +## [v2.10.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.9.0...v2.10.0) (2021-01-08) + +### Chore + +* updates changelog for 2.10.0 +* ignores testing folders +* adds separate bug and ft req templates + +### Ci + +* bumps to docker version 20.10.1 +* pins workflows to ubuntu:20.04 image + +### Docs + +* add labels to arguments of docker_service ([#105](https://github.com/kreuzwerker/terraform-provider-docker/issues/105)) +* cleans readme +* adds coc and contributing + +### Feat + +* supports Docker plugin ([#35](https://github.com/kreuzwerker/terraform-provider-docker/issues/35)) +* support max replicas of Docker Service Task Spec ([#112](https://github.com/kreuzwerker/terraform-provider-docker/issues/112)) +* add force_remove option to r/image ([#104](https://github.com/kreuzwerker/terraform-provider-docker/issues/104)) +* add local semantic commit validation ([#99](https://github.com/kreuzwerker/terraform-provider-docker/issues/99)) +* add ability to lint/check of links in documentation locally ([#98](https://github.com/kreuzwerker/terraform-provider-docker/issues/98)) + +### Fix + +* set "latest" to tag when tag isn't specified ([#117](https://github.com/kreuzwerker/terraform-provider-docker/issues/117)) +* image label for workflows +* remove all azure cps + +### Pull Requests + +* Merge pull request [#38](https://github.com/kreuzwerker/terraform-provider-docker/issues/38) from kreuzwerker/ci-ubuntu2004-workflow +* Merge pull request [#36](https://github.com/kreuzwerker/terraform-provider-docker/issues/36) from kreuzwerker/chore-gh-issue-tpl + + + +## [v2.9.0](https://github.com/kreuzwerker/terraform-provider-docker/compare/v2.8.0...v2.9.0) (2020-12-25) + +### Chore + +* updates changelog for 2.9.0 +* update changelog 2.8.0 release date +* introduces golangci-lint ([#32](https://github.com/kreuzwerker/terraform-provider-docker/issues/32)) +* fix changelog links + +### Ci + +* add gofmt's '-s' option +* remove unneeded make tasks +* fix test of website + +### Doc + +* devices is a block, not a boolean + +### Feat + +* adds support for OCI manifests ([#316](https://github.com/kreuzwerker/terraform-provider-docker/issues/316)) +* adds security_opts to container config. ([#308](https://github.com/kreuzwerker/terraform-provider-docker/issues/308)) +* adds support for init process injection for containers. ([#300](https://github.com/kreuzwerker/terraform-provider-docker/issues/300)) + +### Fix + +* changing mounts requires ForceNew ([#314](https://github.com/kreuzwerker/terraform-provider-docker/issues/314)) +* allow healthcheck to be computed as container can specify ([#312](https://github.com/kreuzwerker/terraform-provider-docker/issues/312)) +* treat null user as a no-op ([#318](https://github.com/kreuzwerker/terraform-provider-docker/issues/318)) +* workdir null behavior ([#320](https://github.com/kreuzwerker/terraform-provider-docker/issues/320)) + +### Style + +* format with gofumpt + +### Pull Requests + +* Merge pull request [#33](https://github.com/kreuzwerker/terraform-provider-docker/issues/33) from brandonros/patch-1 +* Merge pull request [#11](https://github.com/kreuzwerker/terraform-provider-docker/issues/11) from suzuki-shunsuke/format-with-gofumpt +* Merge pull request [#26](https://github.com/kreuzwerker/terraform-provider-docker/issues/26) from kreuzwerker/ci/fix-website-ci +* Merge pull request [#8](https://github.com/kreuzwerker/terraform-provider-docker/issues/8) from dubo-dubon-duponey/patch1 + + + +## v2.8.0 (2020-11-11) + +### Chore + +* updates changelog for 2.8.0 +* removes travis.yml +* deactivates travis +* removes vendor dir ([#298](https://github.com/kreuzwerker/terraform-provider-docker/issues/298)) +* bump go 115 ([#297](https://github.com/kreuzwerker/terraform-provider-docker/issues/297)) +* documentation updates ([#286](https://github.com/kreuzwerker/terraform-provider-docker/issues/286)) +* updates link syntax ([#287](https://github.com/kreuzwerker/terraform-provider-docker/issues/287)) +* fix typo ([#292](https://github.com/kreuzwerker/terraform-provider-docker/issues/292)) + +### Ci + +* reactivats all workflows +* fix website +* only run website workflow +* exports gopath manually +* fix absolute gopath for website +* make website check separate workflow +* fix workflow names +* adds website test to unit test +* adds acc test +* adds compile +* adds go version and goproxy env +* enables unit tests for master branch +* adds unit test workflow +* adds goreleaser and gh action +* bumps docker and ubuntu versions ([#241](https://github.com/kreuzwerker/terraform-provider-docker/issues/241)) +* removes debug option from acc tests +* skips test which is flaky only on travis + +### Deps + +* github.com/hashicorp/terraform[@sdk](https://github.com/sdk)-v0.11-with-go-modules Updated via: go get github.com/hashicorp/terraform[@sdk](https://github.com/sdk)-v0.11-with-go-modules and go mod tidy +* use go modules for dep mgmt run go mod tidy remove govendor from makefile and travis config set appropriate env vars for go modules + +### Docker + +* improve validation of runtime constraints + +### Docs + +* update container.html.markdown ([#278](https://github.com/kreuzwerker/terraform-provider-docker/issues/278)) +* update service.html.markdown ([#281](https://github.com/kreuzwerker/terraform-provider-docker/issues/281)) +* update restart_policy for service. Closes [#228](https://github.com/kreuzwerker/terraform-provider-docker/issues/228) +* adds new label structure. Closes [#214](https://github.com/kreuzwerker/terraform-provider-docker/issues/214) +* update anchors with -1 suffix ([#178](https://github.com/kreuzwerker/terraform-provider-docker/issues/178)) +* Fix misspelled words +* Fix exported attribute name in docker_registry_image +* Fix example for docker_registry_image ([#8308](https://github.com/kreuzwerker/terraform-provider-docker/issues/8308)) +* provider/docker - network settings attrs + +### Feat + +* conditionally adding port binding ([#293](https://github.com/kreuzwerker/terraform-provider-docker/issues/293)). +* adds docker Image build feature ([#283](https://github.com/kreuzwerker/terraform-provider-docker/issues/283)) +* adds complete support for Docker credential helpers ([#253](https://github.com/kreuzwerker/terraform-provider-docker/issues/253)) +* Expose IPv6 properties as attributes +* allow use of source file instead of content / content_base64 ([#240](https://github.com/kreuzwerker/terraform-provider-docker/issues/240)) +* supports to update docker_container ([#236](https://github.com/kreuzwerker/terraform-provider-docker/issues/236)) +* support to import some docker_container's attributes ([#234](https://github.com/kreuzwerker/terraform-provider-docker/issues/234)) +* adds config file content as plain string ([#232](https://github.com/kreuzwerker/terraform-provider-docker/issues/232)) +* make UID, GID, & mode for secrets and configs configurable ([#231](https://github.com/kreuzwerker/terraform-provider-docker/issues/231)) +* adds import for resources ([#196](https://github.com/kreuzwerker/terraform-provider-docker/issues/196)) +* add container ipc mode. ([#182](https://github.com/kreuzwerker/terraform-provider-docker/issues/182)) +* adds container working dir ([#181](https://github.com/kreuzwerker/terraform-provider-docker/issues/181)) + +### Fix + +* ignores 'remove_volumes' on container import +* duplicated buildImage function +* port objects with the same internal port but different protocol trigger recreation of container ([#274](https://github.com/kreuzwerker/terraform-provider-docker/issues/274)) +* panic to migrate schema of docker_container from v1 to v2 ([#271](https://github.com/kreuzwerker/terraform-provider-docker/issues/271)). Closes [#264](https://github.com/kreuzwerker/terraform-provider-docker/issues/264) +* pins docker registry for tests to v2.7.0 +* prevent force recreate of container about some attributes ([#269](https://github.com/kreuzwerker/terraform-provider-docker/issues/269)) +* service endpoint spec flattening +* corrects IPAM config read on the data provider ([#229](https://github.com/kreuzwerker/terraform-provider-docker/issues/229)) +* replica to 0 in current schema. Closes [#221](https://github.com/kreuzwerker/terraform-provider-docker/issues/221) +* label for network and volume after improt +* binary upload as base 64 content ([#194](https://github.com/kreuzwerker/terraform-provider-docker/issues/194)) +* service env truncation for multiple delimiters ([#193](https://github.com/kreuzwerker/terraform-provider-docker/issues/193)) +* destroy_grace_seconds are considered ([#179](https://github.com/kreuzwerker/terraform-provider-docker/issues/179)) + +### Make + +* Add website + website-test targets + +### Provider + +* Ensured Go 1.11 in TravisCI and README provider: Run go fix provider: Run go fmt provider: Encode go version 1.11.5 to .go-version file +* Require Go 1.11 in TravisCI and README provider: Run go fix provider: Run go fmt + +### Tests + +* Skip test if swap limit isn't available ([#136](https://github.com/kreuzwerker/terraform-provider-docker/issues/136)) +* Simplify Dockerfile(s) + +### Vendor + +* github.com/hashicorp/terraform/...[@v0](https://github.com/v0).10.0 +* Ignore github.com/hashicorp/terraform/backend + +### Website + +* Docs sweep for lists & maps +* note on docker +* docker docs + +### Pull Requests + +* Merge pull request [#134](https://github.com/kreuzwerker/terraform-provider-docker/issues/134) from terraform-providers/go-modules-2019-03-01 +* Merge pull request [#135](https://github.com/kreuzwerker/terraform-provider-docker/issues/135) from terraform-providers/t-simplify-dockerfile +* Merge pull request [#47](https://github.com/kreuzwerker/terraform-provider-docker/issues/47) from captn3m0/docker-link-warning +* Merge pull request [#60](https://github.com/kreuzwerker/terraform-provider-docker/issues/60) from terraform-providers/f-make-website +* Merge pull request [#23](https://github.com/kreuzwerker/terraform-provider-docker/issues/23) from JamesLaverack/patch-1 +* Merge pull request [#18](https://github.com/kreuzwerker/terraform-provider-docker/issues/18) from terraform-providers/vendor-tf-0.10 +* Merge pull request [#5046](https://github.com/kreuzwerker/terraform-provider-docker/issues/5046) from tpounds/use-built-in-schema-string-hash +* Merge pull request [#3761](https://github.com/kreuzwerker/terraform-provider-docker/issues/3761) from ryane/f-provider-docker-improvements +* Merge pull request [#3383](https://github.com/kreuzwerker/terraform-provider-docker/issues/3383) from apparentlymart/docker-container-command-docs +* Merge pull request [#1564](https://github.com/kreuzwerker/terraform-provider-docker/issues/1564) from nickryand/docker_links + diff --git a/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/LICENSE b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/README.md b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/README.md new file mode 100644 index 0000000..1f21b51 --- /dev/null +++ b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/README.md @@ -0,0 +1,117 @@ + + Docker logo + + + Terraform logo + + + Kreuzwerker logo + + +# Terraform Provider for Docker + +[![Release](https://img.shields.io/github/v/release/kreuzwerker/terraform-provider-docker)](https://github.com/kreuzwerker/terraform-provider-docker/releases) +[![Installs](https://img.shields.io/badge/dynamic/json?logo=terraform&label=installs&query=$.data.attributes.downloads&url=https%3A%2F%2Fregistry.terraform.io%2Fv2%2Fproviders%2F713)](https://registry.terraform.io/providers/kreuzwerker/docker) +[![Registry](https://img.shields.io/badge/registry-doc%40latest-lightgrey?logo=terraform)](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kreuzwerker/terraform-provider-docker/blob/main/LICENSE) +[![Go Status](https://github.com/kreuzwerker/terraform-provider-docker/workflows/Acc%20Tests/badge.svg)](https://github.com/kreuzwerker/terraform-provider-docker/actions) +[![Lint Status](https://github.com/kreuzwerker/terraform-provider-docker/workflows/golangci-lint/badge.svg)](https://github.com/kreuzwerker/terraform-provider-docker/actions) +[![Go Report Card](https://goreportcard.com/badge/github.com/kreuzwerker/terraform-provider-docker)](https://goreportcard.com/report/github.com/kreuzwerker/terraform-provider-docker) + +## Documentation + +The documentation for the provider is available on the [Terraform Registry](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs). + +Do you want to migrate from `v2.x` to `v3.x`? Please read the [migration guide](docs/v2_v3_migration.md) + +## Example usage + +Take a look at the examples in the [documentation](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs) of the registry +or use the following example: + + +```hcl +# Set the required provider and versions +terraform { + required_providers { + # We recommend pinning to the specific version of the Docker Provider you're using + # since new versions are released frequently + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + } +} + +# Configure the docker provider +provider "docker" { +} + +# Create a docker image resource +# -> docker pull nginx:latest +resource "docker_image" "nginx" { + name = "nginx:latest" + keep_locally = true +} + +# Create a docker container resource +# -> same as 'docker run --name nginx -p8080:80 -d nginx:latest' +resource "docker_container" "nginx" { + name = "nginx" + image = docker_image.nginx.image_id + + ports { + external = 8080 + internal = 80 + } +} + +# Or create a service resource +# -> same as 'docker service create -d -p 8081:80 --name nginx-service --replicas 2 nginx:latest' +resource "docker_service" "nginx_service" { + name = "nginx-service" + task_spec { + container_spec { + image = docker_image.nginx.repo_digest + } + } + + mode { + replicated { + replicas = 2 + } + } + + endpoint_spec { + ports { + published_port = 8081 + target_port = 80 + } + } +} +``` + +## Building The Provider + +[Go](https://golang.org/doc/install) 1.18.x (to build the provider plugin) + + +```sh +$ git clone git@github.com:kreuzwerker/terraform-provider-docker +$ make build +``` + +## Contributing + +The Terraform Docker Provider is the work of many of contributors. We appreciate your help! + +To contribute, please read the contribution guidelines: [Contributing to Terraform - Docker Provider](CONTRIBUTING.md) + +## License + +The Terraform Provider Docker is available to everyone under the terms of the Mozilla Public License Version 2.0. [Take a look the LICENSE file](LICENSE). + + +## Stargazers over time + +[![Stargazers over time](https://starchart.cc/kreuzwerker/terraform-provider-docker.svg)](https://starchart.cc/kreuzwerker/terraform-provider-docker) diff --git a/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/terraform-provider-docker_v3.0.2 b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/terraform-provider-docker_v3.0.2 new file mode 100755 index 0000000..cbf0bcb Binary files /dev/null and b/submitions/lab5/terraform/.terraform/providers/registry.terraform.io/kreuzwerker/docker/3.0.2/linux_amd64/terraform-provider-docker_v3.0.2 differ diff --git a/submitions/lab5/terraform/.terraformrc b/submitions/lab5/terraform/.terraformrc new file mode 100644 index 0000000..77c8f36 --- /dev/null +++ b/submitions/lab5/terraform/.terraformrc @@ -0,0 +1,5 @@ +provider_installation { + network_mirror { + url = "https://terraform-registry-mirror.ru/" + } +} \ No newline at end of file diff --git a/submitions/lab5/terraform/1.png b/submitions/lab5/terraform/1.png new file mode 100644 index 0000000..9630831 Binary files /dev/null and b/submitions/lab5/terraform/1.png differ diff --git a/submitions/lab5/terraform/2.png b/submitions/lab5/terraform/2.png new file mode 100644 index 0000000..91b9529 Binary files /dev/null and b/submitions/lab5/terraform/2.png differ diff --git a/submitions/lab5/terraform/3.png b/submitions/lab5/terraform/3.png new file mode 100644 index 0000000..d95ba44 Binary files /dev/null and b/submitions/lab5/terraform/3.png differ diff --git a/submitions/lab5/terraform/4.png b/submitions/lab5/terraform/4.png new file mode 100644 index 0000000..7ed15ad Binary files /dev/null and b/submitions/lab5/terraform/4.png differ diff --git a/submitions/lab5/terraform/main.tf b/submitions/lab5/terraform/main.tf new file mode 100644 index 0000000..1e50056 --- /dev/null +++ b/submitions/lab5/terraform/main.tf @@ -0,0 +1,24 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~> 3.0.1" + } + } +} + +provider "docker" {} + +resource "docker_image" "nginx" { + name = "nginx:latest" + keep_locally = false +} + +resource "docker_container" "nginx" { + image = docker_image.nginx.image_id + name = "tutorial" + ports { + internal = 80 + external = 8080 + } +} \ No newline at end of file diff --git a/submitions/lab5/terraform/terraform.md b/submitions/lab5/terraform/terraform.md new file mode 100644 index 0000000..90f7204 --- /dev/null +++ b/submitions/lab5/terraform/terraform.md @@ -0,0 +1,90 @@ +# Terraform + +## Task 2 + +1. Run terraform container (cause why not) + + ``` + docker run -it --name terraformLab -v ./submitions/lab5/terraform:/terraform_config --entrypoint=sh hashicorp/terraform:latest + ``` + +2. Create "main.tf" according to the build guide + ```tf + terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~> 3.0.1" + } + } + } + + provider "docker" {} + + resource "docker_image" "nginx" { + name = "nginx:latest" + keep_locally = false + } + + resource "docker_container" "nginx" { + image = docker_image.nginx.image_id + name = "tutorial" + ports { + internal = 80 + external = 8000 + } + } + ``` + +3. Try to `terraform init` and fail since we are in Russia + +4. change the provided mirror to some random mirror from random habr article and sucseed in `terraform init`. Also make a volume for `.terraformrc` + ``` + docker run -it --name terraformLab -v ./submitions/lab5/terraform:/terraform_config -v ./submitions/lab5/terraform/.terraformrc:/root/.terraformrc --entrypoint=sh hashicorp/terraform:latest + ``` + + ![alt text](2.png) + +5. Format and validate + + ``` + /terraform_config # terraform fmt + main.tf + /terraform_config # terraform validate + Success! The configuration is valid. + ``` + +6. Realize there is no docker inside terraform container and give up while installing it + +7. Install terraform localy and put `.terraformrc` to home dir + +8. apply the configuration + + ![alt text](1.png) + ``` + terraform state list + docker_container.nginx + docker_image.nginx + ``` + +9. Change the config and apply changes + + ![alt text](3.png) + +10. destroy the config + + ![alt text](4.png) + +## Some lab stuff + +- terraform version: v1.8.5 +- instalation process??? (have no idea why you need it, it is not a rocket science after all): + - add terraform to NixOS config file and rebuild the system + - or `pacman -S terraform` + - or `apt-get install terraform` + - or (for Alpine) + ```sh + wget https://releases.hashicorp.com/terraform/0.12.21/terraform_0.12.21_linux_amd64.zip + unzip terraform_0.12.21_linux_amd64.zip && rm terraform_0.12.21_linux_amd64.zip + mv terraform /usr/bin/terraform + ``` \ No newline at end of file diff --git a/submitions/lab5/terraform/terraform.tfstate b/submitions/lab5/terraform/terraform.tfstate new file mode 100644 index 0000000..30ee005 --- /dev/null +++ b/submitions/lab5/terraform/terraform.tfstate @@ -0,0 +1,9 @@ +{ + "version": 4, + "terraform_version": "1.8.5", + "serial": 9, + "lineage": "5ebe6d66-5c93-4cc9-3436-8d6c07f2e915", + "outputs": {}, + "resources": [], + "check_results": null +} diff --git a/submitions/lab5/terraform/terraform.tfstate.backup b/submitions/lab5/terraform/terraform.tfstate.backup new file mode 100644 index 0000000..c3a9106 --- /dev/null +++ b/submitions/lab5/terraform/terraform.tfstate.backup @@ -0,0 +1,144 @@ +{ + "version": 4, + "terraform_version": "1.8.5", + "serial": 6, + "lineage": "5ebe6d66-5c93-4cc9-3436-8d6c07f2e915", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "docker_container", + "name": "nginx", + "provider": "provider[\"registry.terraform.io/kreuzwerker/docker\"]", + "instances": [ + { + "schema_version": 2, + "attributes": { + "attach": false, + "bridge": "", + "capabilities": [], + "cgroupns_mode": null, + "command": [ + "nginx", + "-g", + "daemon off;" + ], + "container_logs": null, + "container_read_refresh_timeout_milliseconds": 15000, + "cpu_set": "", + "cpu_shares": 0, + "destroy_grace_seconds": null, + "devices": [], + "dns": null, + "dns_opts": null, + "dns_search": null, + "domainname": "", + "entrypoint": [ + "/docker-entrypoint.sh" + ], + "env": [], + "exit_code": null, + "gpus": null, + "group_add": null, + "healthcheck": null, + "host": [], + "hostname": "8fe9dcf288a9", + "id": "8fe9dcf288a9c3a0a5306ceba75c79a0343493f62bda1b532a9b932bbaca28ef", + "image": "sha256:fffffc90d343cbcb01a5032edac86db5998c536cd0a366514121a45c6723765c", + "init": false, + "ipc_mode": "private", + "labels": [], + "log_driver": "journald", + "log_opts": null, + "logs": false, + "max_retry_count": 0, + "memory": 0, + "memory_swap": 0, + "mounts": [], + "must_run": true, + "name": "tutorial", + "network_data": [ + { + "gateway": "172.17.0.1", + "global_ipv6_address": "", + "global_ipv6_prefix_length": 0, + "ip_address": "172.17.0.2", + "ip_prefix_length": 16, + "ipv6_gateway": "", + "mac_address": "02:42:ac:11:00:02", + "network_name": "bridge" + } + ], + "network_mode": "default", + "networks_advanced": [], + "pid_mode": "", + "ports": [ + { + "external": 8080, + "internal": 80, + "ip": "0.0.0.0", + "protocol": "tcp" + } + ], + "privileged": false, + "publish_all_ports": false, + "read_only": false, + "remove_volumes": true, + "restart": "no", + "rm": false, + "runtime": "runc", + "security_opts": [], + "shm_size": 64, + "start": true, + "stdin_open": false, + "stop_signal": "SIGQUIT", + "stop_timeout": 0, + "storage_opts": null, + "sysctls": null, + "tmpfs": null, + "tty": false, + "ulimit": [], + "upload": [], + "user": "", + "userns_mode": "", + "volumes": [], + "wait": false, + "wait_timeout": 60, + "working_dir": "" + }, + "sensitive_attributes": [], + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==", + "dependencies": [ + "docker_image.nginx" + ] + } + ] + }, + { + "mode": "managed", + "type": "docker_image", + "name": "nginx", + "provider": "provider[\"registry.terraform.io/kreuzwerker/docker\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "build": [], + "force_remove": null, + "id": "sha256:fffffc90d343cbcb01a5032edac86db5998c536cd0a366514121a45c6723765cnginx:latest", + "image_id": "sha256:fffffc90d343cbcb01a5032edac86db5998c536cd0a366514121a45c6723765c", + "keep_locally": false, + "name": "nginx:latest", + "platform": null, + "pull_triggers": null, + "repo_digest": "nginx@sha256:67682bda769fae1ccf5183192b8daf37b64cae99c6c3302650f6f8bf5f0f95df", + "triggers": null + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + } + ], + "check_results": null +} diff --git a/submitions/lab6/submition6.md b/submitions/lab6/submition6.md new file mode 100644 index 0000000..60166cd --- /dev/null +++ b/submitions/lab6/submition6.md @@ -0,0 +1,179 @@ +# Lab6 + +## Task 1 + +1. `system-analize` + ``` + wat4er@wat4er  ~/Master/devops/Sum24-intro-labs   master  systemd-analyze + Startup finished in 8.733s (firmware) + 1.661s (loader) + 10.869s (kernel) + 36.645s (userspace) = 57.909s + graphical.target reached after 36.644s in userspace. + wat4er@wat4er  ~/Master/devops/Sum24-intro-labs   master  systemd-analyze blame + 30.165s NetworkManager-wait-online.service + 2.318s systemd-modules-load.service + 1.683s NetworkManager.service + 1.250s docker.service + 822ms systemd-fsck@dev-disk-by\x2duuid-54690d56\x2da064\x2d4418\x2d8541\x2dc51a089e0c5a.service + 547ms dev-disk-by\x2duuid-497791ab\x2d6339\x2d4e9b\x2dbd3d\x2d574da9f614ae.device + 387ms systemd-backlight@backlight:intel_backlight.service + 359ms udisks2.service + 357ms systemd-udev-trigger.service + 331ms home-manager-wat4er.service + 230ms user@1000.service + 205ms firewall.service + 194ms systemd-journal-flush.service + 190ms mount-pstore.service + 174ms systemd-tmpfiles-clean.service + 170ms systemd-journald.service + 153ms systemd-tmpfiles-setup-dev-early.service + 145ms systemd-pstore.service + 145ms systemd-remount-fs.service + 137ms upower.service + 135ms accounts-daemon.service + 119ms run-media-wat4er-porn.mount + 113ms modprobe@efi_pstore.service + 110ms bluetooth.service + 104ms dbus.service + 97ms modprobe@fuse.service + 96ms boot.mount + 95ms suid-sgid-wrappers.service + 85ms modprobe@drm.service + 83ms systemd-timesyncd.service + 77ms systemd-random-seed.service + 73ms modprobe@configfs.service + 71ms kmod-static-nodes.service + 67ms systemd-backlight@leds:dell::kbd_backlight.service + 66ms resolvconf.service + 64ms dev-mqueue.mount + 64ms sys-kernel-debug.mount + 63ms cups.service + 63ms dev-hugepages.mount + 62ms polkit.service + 62ms ModemManager.service + 60ms systemd-rfkill.service + 53ms systemd-fsck@dev-disk-by\x2duuid-2049\x2d091F.service + 51ms alsa-store.service + 48ms systemd-logind.service + 47ms network-setup.service + 42ms power-profiles-daemon.service + 39ms nvidia-persistenced.service + 38ms systemd-tmpfiles-setup.service + 38ms systemd-oomd.service + 37ms systemd-udevd.service + 35ms systemd-update-utmp.service + 32ms systemd-vconsole-setup.service + 30ms systemd-sysctl.service + 29ms audit.service + 28ms logrotate-checkconf.service + 25ms systemd-boot-random-seed.service + 21ms wpa_supplicant.service + 19ms network-local-commands.service + 17ms NetworkManager-dispatcher.service + 17ms systemd-tmpfiles-setup-dev.service + 15ms user-runtime-dir@1000.service + 15ms systemd-user-sessions.service + 13ms sys-fs-fuse-connections.mount + 13ms sys-kernel-config.mount + 12ms display-manager.service + 9ms nscd.service + 7ms rtkit-daemon.service + 1ms docker.socket + ``` + - My system loads in a minute (which is about right) + - The longest service to load is "NetworkManager-wait-online.service" + +2. `uptime` + ``` + wat4er@wat4er  ~/Master/devops/Sum24-intro-labs   master  uptime + 04:38:44 up 4 days 8:26, 1 user, load average: 0,42, 0,82, 1,28 + ``` + - Shows how long is system up + - Shows some "magic numbers" is load average + +3. `w` + ``` + wat4er@wat4er  ~/Master/devops/Sum24-intro-labs   master  w + 04:38:48 up 4 days, 8:26, 1 user, load average: 0,42, 0,82, 1,28 + USER TTY LOGIN@ IDLE JCPU PCPU WHAT + wat4er tty3 Вт20 4days 0.49s 0.49s /nix/store/sapa40f2ki28y1l2x1qnd07lwvk28j9d-plasma-workspace-6.0.5.1/bin/startplasma-wayland + ``` + - `w` provides an extended wersion of `uptime` command + +## Task 2 + +1. Install traceroute and dig + ```nix + # configuration.nix + environment.systemPackages = with pkgs; [ + ... + traceroute + dig + ]; + ``` + +2. traceroute + ``` + traceroute google.com + traceroute to google.com (216.239.38.120), 30 hops max, 60 byte packets + 1 _gateway (10.248.1.1) 1.404 ms 1.526 ms 1.638 ms + 2 10.250.0.2 (10.250.0.2) 0.500 ms 0.486 ms 0.471 ms + 3 10.252.6.1 (10.252.6.1) 0.966 ms 0.839 ms 1.122 ms + 4 1.123.18.84.in-addr.arpa (84.18.123.1) 10.343 ms 10.563 ms 10.433 ms + 5 188.170.164.138 (188.170.164.138) 22.837 ms 23.050 ms 23.294 ms + 6 * * * + 7 * * * + 8 * * * + 9 83.169.204.113 (83.169.204.113) 24.442 ms 83.169.204.115 (83.169.204.115) 23.827 ms 83.169.204.117 (83.169.204.117) 23.656 ms + 10 178.176.152.61 (178.176.152.61) 32.130 ms 72.14.222.181 (72.14.222.181) 22.982 ms 23.290 ms + 11 192.178.241.61 (192.178.241.61) 25.389 ms 108.170.250.51 (108.170.250.51) 24.041 ms 192.178.241.157 (192.178.241.157) 22.708 ms + 12 192.178.241.66 (192.178.241.66) 26.185 ms 192.178.241.70 (192.178.241.70) 23.598 ms 192.178.241.146 (192.178.241.146) 24.080 ms + 13 142.251.238.70 (142.251.238.70) 41.042 ms 142.251.237.154 (142.251.237.154) 40.355 ms 209.85.255.136 (209.85.255.136) 40.897 ms + 14 72.14.232.190 (72.14.232.190) 41.220 ms 216.239.58.69 (216.239.58.69) 39.110 ms 172.253.79.113 (172.253.79.113) 40.424 ms + 15 216.239.56.113 (216.239.56.113) 41.165 ms * * + 16 * * * + 17 * * * + 18 * * * + 19 * * * + 20 * * * + 21 * * * + 22 * * * + 23 * * * + 24 * any-in-2678.1e100.net (216.239.38.120) 40.439 ms * + ``` + - This command shows the path to the "google.com" (I guess) + - The most notable thing is that it provides addres of a gate way and addreses of UI DNS servers (I guess 10.250.0.2 and 10.252.6.1 are DNS since they are some what close to our network) + ``` + ip a + enp3s0: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether d8:d0:90:04:32:6f brd ff:ff:ff:ff:ff:ff + inet 10.248.1.20/24 brd 10.248.1.255 scope global dynamic noprefixroute enp3s0 + valid_lft 601162sec preferred_lft 601162sec + inet6 fe80::e359:c5ea:fcf6:340d/64 scope link noprefixroute + valid_lft forever preferred_lft forever + ``` + +3. dig + ``` + dig google.com + + ; <<>> DiG 9.18.27 <<>> google.com + ;; global options: +cmd + ;; Got answer: + ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5669 + ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 + + ;; OPT PSEUDOSECTION: + ; EDNS: version: 0, flags:; udp: 4096 + ; COOKIE: 4735df7ed9b2e02136e2911c669c69a45c1aac35acc562ff (good) + ;; QUESTION SECTION: + ;google.com. IN A + + ;; ANSWER SECTION: + google.com. 47181 IN CNAME forcesafesearch.google.com. + forcesafesearch.google.com. 47971 IN A 216.239.38.120 + + ;; Query time: 1 msec + ;; SERVER: 10.90.137.30#53(10.90.137.30) (UDP) + ;; WHEN: Sun Jul 21 04:51:32 MSK 2024 + ;; MSG SIZE rcvd: 113 + + ``` \ No newline at end of file diff --git a/submitions/lab7/1.png b/submitions/lab7/1.png new file mode 100644 index 0000000..ff36d62 Binary files /dev/null and b/submitions/lab7/1.png differ diff --git a/submitions/lab7/2.png b/submitions/lab7/2.png new file mode 100644 index 0000000..a26db88 Binary files /dev/null and b/submitions/lab7/2.png differ diff --git a/submitions/lab7/3.png b/submitions/lab7/3.png new file mode 100644 index 0000000..f90b780 Binary files /dev/null and b/submitions/lab7/3.png differ diff --git a/submitions/lab7/4.png b/submitions/lab7/4.png new file mode 100644 index 0000000..af40352 Binary files /dev/null and b/submitions/lab7/4.png differ diff --git a/submitions/lab7/5.png b/submitions/lab7/5.png new file mode 100644 index 0000000..9bb02b1 Binary files /dev/null and b/submitions/lab7/5.png differ diff --git a/submitions/lab7/6.png b/submitions/lab7/6.png new file mode 100644 index 0000000..e95b5f4 Binary files /dev/null and b/submitions/lab7/6.png differ diff --git a/submitions/lab7/7.png b/submitions/lab7/7.png new file mode 100644 index 0000000..d69f15a Binary files /dev/null and b/submitions/lab7/7.png differ diff --git a/submitions/lab7/submition7.md b/submitions/lab7/submition7.md new file mode 100644 index 0000000..ae94e2d --- /dev/null +++ b/submitions/lab7/submition7.md @@ -0,0 +1,47 @@ +# Lab7 + +## Task 1 + +1. install VirtualBox + ```nix + # configuyration.nix + virtualisation.virtualbox.host.enable = true; + ``` + - virtualbox version + ``` + Oracle VM VirtualBox VM Selector v7.0.18 + Copyright (C) 2005-2024 Oracle and/or its affiliates + ``` +2. add vbox group to user + ```nix + # configuration.nix + users.users.wat4er.extraGroups = [ ... "vboxusers" ]; + ``` + +3. ubuntu instalation + - most of configuration is still default + - So we have + - 2 CPU cores (instead of 1) + - 2GB of RAM + - 25GB of disk space + + ![alt text](1.png) + ![alt text](2.png) + ![alt text](3.png) + +## Task 2 + +1. cpu + `cat /proc/cpuinfo` + ![alt text](5.png) + +2. memory + `cat /proc/meminfo` + ![alt text](6.png) + +3. OS + `cat /etc/os-release` + ![alt text](7.png) + +4. `inxi -F` + ![alt text](4.png) \ No newline at end of file diff --git a/submitions/lab8/1.png b/submitions/lab8/1.png new file mode 100644 index 0000000..37d2db9 Binary files /dev/null and b/submitions/lab8/1.png differ diff --git a/submitions/lab8/2.png b/submitions/lab8/2.png new file mode 100644 index 0000000..c553601 Binary files /dev/null and b/submitions/lab8/2.png differ diff --git a/submitions/lab8/bubunta.tag b/submitions/lab8/bubunta.tag new file mode 100644 index 0000000..67ca848 Binary files /dev/null and b/submitions/lab8/bubunta.tag differ diff --git a/submitions/lab8/image-1.png b/submitions/lab8/image-1.png new file mode 100644 index 0000000..b70f644 Binary files /dev/null and b/submitions/lab8/image-1.png differ diff --git a/submitions/lab8/image-2.png b/submitions/lab8/image-2.png new file mode 100644 index 0000000..a916576 Binary files /dev/null and b/submitions/lab8/image-2.png differ diff --git a/submitions/lab8/image.png b/submitions/lab8/image.png new file mode 100644 index 0000000..3d3fddd Binary files /dev/null and b/submitions/lab8/image.png differ diff --git a/submitions/lab8/index.html b/submitions/lab8/index.html new file mode 100644 index 0000000..a20a501 --- /dev/null +++ b/submitions/lab8/index.html @@ -0,0 +1,8 @@ + + +The best + + +

website

+ + \ No newline at end of file diff --git a/submitions/lab8/submition8.md b/submitions/lab8/submition8.md new file mode 100644 index 0000000..645cd18 --- /dev/null +++ b/submitions/lab8/submition8.md @@ -0,0 +1,56 @@ +# Lab8 + +## Task 1 + +1. to list all the containers we could use `docker ps -a` (it is a shortcut I was looking for a long time) but `docker container ls -a` is also an appropriate command that does the same + ![alt text](1.png) + +2. I won't pull ubuntu since I already did resently (see [lab4](../lab4/submition4.md)). Also if it is a public image it could be pulled with `docker run ` in case it is not present in a system. However, it won't update witout pull + +3. Run ubuntu container with `docker run -it --name lab8 ubuntu`. In lab4 id did extra work by providing an `--entrypoint` to the container since initially I forgot about `it` flags. Nevertheless, results are the same + ![alt text](2.png) + +4. If attempt to remove image there would be an error since there are containers that uses this image. The containers could be removed with `docker rm ` + +5. Also `docker rm` and `docker rmi` are a shortcuts for `docker container rm` and `docker image rm` respectively as well as `docker ps` is a shortcut for `docker container ls` + +## Task 2 + +1. Create archive with ubntu iamge. The size is comparable + ``` + wat4er@wat4er î‚° ~/Master/devops/Sum24-intro-labs î‚° î‚  master î‚° du ./submitions/lab8/bubunta.tag -h + 77M ./submitions/lab8/bubunta.tag + wat4er@wat4er î‚° ~/Master/devops/Sum24-intro-labs î‚° î‚  master î‚° docker image ls + REPOSITORY TAG IMAGE ID CREATED SIZE + hashicorp/terraform latest af62ce8c3aed 11 days ago 115MB + ipfs/go-ipfs latest 2eac8d47ed7d 5 weeks ago 95.1MB + ubuntu latest 35a88802559d 6 weeks ago 78.1MB + ``` + +2. Run nginx container with index + - `docker run -d -p 80:80 --name nginx_container nginx` + - `docker cp ./submitions/lab8/index.html nginx_container:/usr/share/nginx/html/index.html` + - ![alt text](image.png) + +3. Commit container `docker commit nginx_container my_website:latest` +4. Romove current container `docker stop nginx_container && docker rm nginx_container` +5. Run commited container and test with curl + - `docker run -d -p 80:80 --name my_website_container my_website:latest` + - `curl` + ``` + curl localhost + + + The best + + +

website

+ + % + ``` + +6. `docker diff` + + ![alt text](image-1.png) + - `docker diff` shows the changes in files from the initial image build. It could be seen on the original container + ![alt text](image-2.png) \ No newline at end of file diff --git a/submitions/lab9/1.png b/submitions/lab9/1.png new file mode 100644 index 0000000..2a9d706 Binary files /dev/null and b/submitions/lab9/1.png differ diff --git a/submitions/lab9/2.png b/submitions/lab9/2.png new file mode 100644 index 0000000..7d00bf2 Binary files /dev/null and b/submitions/lab9/2.png differ diff --git a/submitions/lab9/3.png b/submitions/lab9/3.png new file mode 100644 index 0000000..515b106 Binary files /dev/null and b/submitions/lab9/3.png differ diff --git a/submitions/lab9/4.png b/submitions/lab9/4.png new file mode 100644 index 0000000..08f771e Binary files /dev/null and b/submitions/lab9/4.png differ diff --git a/submitions/lab9/5.png b/submitions/lab9/5.png new file mode 100644 index 0000000..c4f8680 Binary files /dev/null and b/submitions/lab9/5.png differ diff --git a/submitions/lab9/6.png b/submitions/lab9/6.png new file mode 100644 index 0000000..76b76d5 Binary files /dev/null and b/submitions/lab9/6.png differ diff --git a/submitions/lab9/metrics.txt b/submitions/lab9/metrics.txt new file mode 100644 index 0000000..f2be576 --- /dev/null +++ b/submitions/lab9/metrics.txt @@ -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 diff --git a/submitions/lab9/submition9.md b/submitions/lab9/submition9.md new file mode 100644 index 0000000..9add0e3 --- /dev/null +++ b/submitions/lab9/submition9.md @@ -0,0 +1,107 @@ +# Lab9 + +## Task 1 + +1. Create basic aciton from the [quickstart guide](https://docs.github.com/en/actions/quickstart) + - create [yml file](../../.github/workflows/lab9.yml) + - Put the contance 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 spesified in `run-name` + ![alt text](1.png) + - The provided example shows the following features of github actions + - We could spesify when to run the action with `on: []` + - 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: `. 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 eather a termenal commands like `- run: echo ""` or third-party actinos created by github users like `- uses: actions/checkout@v4` + - The steps could have its own name defined by `- name: ` + - The actions could use enviromant variables. it icludes: + - Build-in vars: `github.repository` + - Repository vars: `vars.ASDF`, `secrets.ASDF` + - User defined vars: + ```yml + env: + ASDF: + jobs: + JoB: + runs-on: ubuntu-latest + env: + ASDF1: + steps: + - run: echo "$ASDF $ASDF1 $ASDF2" + env: + ASDF2: + ``` + - We could run several jobs in paralel by defining several jobs + ```yml + Job1: + + Job2: + + ``` + - We could run jobs sequentialy by spesifying which jobs has to end before the following job + ```yml + Job1: + + Job2: + needs: [Job1] + + ``` + - The result of sequential and paralel 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 manualy 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 prittyer 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_metrcis_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