From fd2276232d57a85582344b1466eb09419e4622e6 Mon Sep 17 00:00:00 2001 From: KostLinux Date: Sat, 31 Aug 2024 13:00:28 +0300 Subject: [PATCH 1/6] feat: added test task and serverless task --- employment-tasks/README.md | 5 + employment-tasks/devops/alpeso/README.md | 29 ++++ .../devops/alpeso/alpeso-test.tar.gz | Bin 0 -> 17152 bytes employment-tasks/devops/luminor/README.md | 39 +++++ .../software-engineer/entain/README.md | 70 ++++++++ subjects/devops/serverless/README.md | 160 ++++++++++++++++++ subjects/devops/serverless/backend.tf | 0 .../devops/serverless/cloudformation/.gitkeep | 0 subjects/devops/serverless/main.tf | 3 + .../serverless/modules/aws_slack_bot/.gitkeep | 0 .../modules/aws_slack_bot/bot/.gitkeep | 0 11 files changed, 306 insertions(+) create mode 100644 employment-tasks/README.md create mode 100644 employment-tasks/devops/alpeso/README.md create mode 100644 employment-tasks/devops/alpeso/alpeso-test.tar.gz create mode 100644 employment-tasks/devops/luminor/README.md create mode 100644 employment-tasks/software-engineer/entain/README.md create mode 100644 subjects/devops/serverless/README.md create mode 100644 subjects/devops/serverless/backend.tf create mode 100644 subjects/devops/serverless/cloudformation/.gitkeep create mode 100644 subjects/devops/serverless/main.tf create mode 100644 subjects/devops/serverless/modules/aws_slack_bot/.gitkeep create mode 100644 subjects/devops/serverless/modules/aws_slack_bot/bot/.gitkeep diff --git a/employment-tasks/README.md b/employment-tasks/README.md new file mode 100644 index 0000000000..9e4d54828c --- /dev/null +++ b/employment-tasks/README.md @@ -0,0 +1,5 @@ +# Test tasks from the real job interviews + +This folder is used to store test tasks from the real job interviews. The tasks are stored in the `test-tasks` folder. Each task is stored in a separate folder with the name of the company that provided the task. Inside the company folder, there is a `README.md` file with the task description. + +The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack. \ No newline at end of file diff --git a/employment-tasks/devops/alpeso/README.md b/employment-tasks/devops/alpeso/README.md new file mode 100644 index 0000000000..92e25f87d6 --- /dev/null +++ b/employment-tasks/devops/alpeso/README.md @@ -0,0 +1,29 @@ +# Alpeso + +# Alpeso Recruiting - SENIOR DEVOPS ENGINEER + +This is a test project within Alpeso's technical recruiting process. + +Look at the following tasks and estimate how much time you will spend on them. + +In doubt of technical issues you can send an e-mail with your questions. + +## Preconditions + +### Technical & Knowledge +You need at least: + +* Experience with AWS stack +* Experience with CI/CD +* Experience with Bash scripts +* Experience in at least one programming language (Java, Python, PHP, Perl, etc.) +* A text editor of your choice + +## The tasks +1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. + +2) You have the alpeso-test.tar.gz archive. What we can improve? + +3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". +Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. +Hint: https://aws.amazon.com/free/ \ No newline at end of file diff --git a/employment-tasks/devops/alpeso/alpeso-test.tar.gz b/employment-tasks/devops/alpeso/alpeso-test.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1088eb56980516fcec3ad0704da907588953edf3 GIT binary patch literal 17152 zcmZU)RZyKx*M^B(u;3cpgS)#!Ah>JLAi>jO&qPNa;6EB zqvlL<--n~q2?wq-YwLFItfJyenta#Y9(FVo*NC8qD9WK?N@~3Kf&-=!mr|0LpRo~N z!55wU?e+3}%U{}4+{Koxz4q5H0tR2YE&|k)Xz`^V(xc3u?LBcWMJOxLN@c5PR2RRt3(@$8>jyLQm9Kd$a(Be0LSwl{w)BPJ${!v10 zUQ;bDB%`W{f5y=|_nxc{)r3nA^U*?n1b0n~FUD0H=eq=z4%N;v#hR!S^%*xG|E=Y; zSu&UbJIOfg8}`ZLKYp_5#G_rIdkY%3kS4N+5L z&SdtpXe(jjoV7X5!pA7%&c9bR6i|!0QL0V1APU%1O&XOoFj4zE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)( zz{rdsiT`xa!j^x|`QM8=wzwF$VYk%G~pFg4fo3E_6<(@fj?KtiIo)dqTUj6$M&kJ@R z__wb;(to?L_umiud%Jw-vsWg5{ZpxDub-&?qm;+w2O3^@{hjwN{?$)n8&1Av!{1K+ z#P^>)>-5Y1wd{v`XxBco@4L%iJoX2k-@edrUTn+brya56@2Bs3!wJvu7hX5wJLAk( zf7yF=a=dnkfb>6=BHK~g~et!Lr ze%pA^=MEN|ZrpZ(eA9j09)lO3pPqNyy{FX-f9s;pJp9j4i}B+_M!)i}`%j&*V1Dwe XyLu`daKHfvstW%P2qxPT02~4U8dIG~ literal 0 HcmV?d00001 diff --git a/employment-tasks/devops/luminor/README.md b/employment-tasks/devops/luminor/README.md new file mode 100644 index 0000000000..0d82ced4a2 --- /dev/null +++ b/employment-tasks/devops/luminor/README.md @@ -0,0 +1,39 @@ +# Luminor Test Task + +## Part 1 – The Web Service + +Write a web service in any language that takes in a JSON payload, does +some basic validation against an expected message format and content, +and then puts that payload into a queue of your choice or a file. + +Example valid payload: +```json +{ + "ts": "1530228282", + "sender": "curler-user", + "message": { + "foo": "bar", + "hash": "bash" + }, + "sent-from-ip": "1.2.3.4" +} +``` + +Validation rules: +● “ts” must be present and a valid Unix timestamp +● “sender” must be present and a string +● “message” must be present, a JSON object, and have at least one +field set +● If present, “sent-from-ip” must be a valid IPv4 address +● All fields not listed in the example above are invalid, and +should result in the message being rejected. + +## Part 2 – Terraform + +Deploy this application to your favourite cloud provider using Terraform. + +## Part 3 – NewRelic + +Implement NewRelic monitoring for this application using Terraform. + +Please send finished code, testing and results through mail. \ No newline at end of file diff --git a/employment-tasks/software-engineer/entain/README.md b/employment-tasks/software-engineer/entain/README.md new file mode 100644 index 0000000000..0d04ba74b1 --- /dev/null +++ b/employment-tasks/software-engineer/entain/README.md @@ -0,0 +1,70 @@ +# Entain + +Entain is one of the biggest companies, which hosts casinos like Olybet, Optibet etc. They are looking for a software engineer to join their team. + +## Task + +### Tools and technologies used: + +1. Go +2. PostgreSQL +3. Docker +4. Makefile +5. Postman + +All database tables are in `migrations` folder. To run them, use `make` command. + +1. `make migrate-up` - to run up migrations +2. `make migrate-down` - to run down migrations +3. `make migrate-force` - to force run migrations if you have some errors like `error: Dirty database version -1. Fix and force version.` + +### Tables: + +1. `users` - contains users data +2. `transaction` - contains transactions data + +### Endpoints to test: + +1. `GET /users` - to get all users +2. `GET /users/{user_id}` - to get user by id, check his balance +3. `GET /transactions/{user_id}` - to get all transactions by user id (check if user has any transactions) +4. `POST /process-record/{user_id}` - to process record by user id + +Process record request body example: + +``` +{ + "amount": 10, + "transaction_id": "64338a05-81e5-426b-b01e-927e447c9e33", + "state": "win" +} +``` + +Transaction id is unique, so you can't process the same transaction twice, provide UUID v4 format. +State can be `win` or `lose`. +Amount is a number should be positive but to have a negative balance you should provide a `lose` state. + +### Required header for all endpoints: + +1. `Source-Type: game` - available values: `game`, `server`, `payment` + +Postman collection is in `postman` folder to test endpoints. + +## To run the app locally: + +1. Create `.env` file in root folder and add all required variables from `.env.example` file +2. To run migrations you should have migrate tool installed. You can install it with `brew install golang-migrate` (https://github.com/golang-migrate/migrate/tree/master/cmd/migrate) +3. To run any `make` command you should have `make` tool installed. You can install it with `sudo apt install make` command (https://linuxhint.com/install-make-ubuntu/) +4. Run `make migrate-up` command to run migrations and create all tables with test user (user_id: `63e83104-b9a7-4fec-929e-9d08cae3f9b9`) +5. Run `make run` command to run application +6. Take a look at `postman` folder to take collection for testing all endpoints + +Test user with id `63e83104-b9a7-4fec-929e-9d08cae3f9b9` will be created automatically when you run migrations. +This user has 50 amount of his balance for testing. + +## To run application in docker container: + +1. Create `.env` file in root folder and add all required variables from `.env.example` file +2. To run docker container you should have `docker` and `docker-compose` tools installed (Tested on `Docker version 26.1.3, build b72abbb` and `Docker Compose version v2.27.1`) +3. `docker-compose up` - to run application in docker container +4. `docker-compose down` - to stop application in docker container \ No newline at end of file diff --git a/subjects/devops/serverless/README.md b/subjects/devops/serverless/README.md new file mode 100644 index 0000000000..0a54698896 --- /dev/null +++ b/subjects/devops/serverless/README.md @@ -0,0 +1,160 @@ +## Serverless Payments Reminder + +Serverless Payments Reminder is a basic Slack Bot that reminds companies / users to pay their bills. The reminder gets triggered by AWS EventBridge (also known as CloudWatch Events). The bot itself is hosted on a simple AWS Lambda function. + +### Requirements for the task + +Create a simple Slack bot using: + +- [AWS](https://aws.amazon.com/) +- [Serverless Framework](https://serverless.com/) +- [Cloudformation](https://aws.amazon.com/cloudformation/) +- [Terraform](https://www.terraform.io/) + +### Task + +The task is separated into multiple different levels. The levels are ordered by complexity. You can choose the level that you feel most comfortable with. + +## Level 0: Basic Lambda Function hosted via Serverless** + +**1. Create Slack Bot** + +Write a slack bot, that sends a reminder to slack channel with the following message: + +```sh +Dear Board Members! This is a reminder to make the payment for the licenses of the software. The due date is 07.XX.YY, where XX is the month and YY is the year. The amount to be paid is $ZZZ.VV. Please make the payment as soon as possible to . Thank you! +``` + +The environment variables which must be available in the Lambda function are: + +- `SLACK_WEBHOOK_URL` - The Slack Webhook URL +- `AMOUNT` - The amount to be paid +- `IBAN_NUMBER` - The IBAN number + +The due date must be calculated based on the current date for the next month. + +Before step two, you need to test that Slack Bot is functioning properly by running an application locally. It should send a message to the Slack channel. + +**2. Write tests for the application** + +Write integration tests for the application to ensure that each part of the application is functioning properly. + +**3. Use [Serverless Framework](https://github.com/serverless/serverless) to host the lambda function** + +Serverless framework is an automation tool used to deploy serverless applications which can help with event-driven architecture deployments. + +Use the serverless framework to host the lambda function combined with AWS Eventbridge. + +**Refs** + +- [AWS EventBridge](https://www.serverless.com/framework/docs/providers/aws/events/event-bridge) +- [AWS Lambda Function](https://www.serverless.com/framework/docs/providers/aws/guide/functions). + +AWS Eventbridge should trigger lambda function every month on the 1st day of the month at 10:00 AM. + +**Note** Before hosting, you need to ensure that the bot is written in a way that it can be hosted on AWS Lambda. You can look at the example [here](https://github.com/KostLinux/aws-incident-manager-notifier/blob/56d52e90f8a14e689e7d2a1c7ee44590de5af2f5/main.go#L158). + +## Level 1: Basic Lambda Function automation via Cloudformation** + +**1. Repeat the 1st and 2nd step from Level 0** + +Create a slack bot, that sends a reminder to slack channel. Write integration tests for the application to ensure that each part of the application is functioning properly. + +**Note** Don't forget to add Lambda handler for the application + +**2. Use [Cloudformation](https://aws.amazon.com/cloudformation/) to host the lambda function** + +Cloudformation is Infrastructure As Code (IaC) tool used to automate the provisioning of AWS resources inside the AWS. It allows you to use a simple yaml syntax to define the resources you want to create. + +**2.1 Hosting the Lambda function** + +Write cloudformation template with parameters (variables) `SlackWebhookUrl`, `Amount`, `IbanNumber`. The template should automatically provision the Slackbot based on architecture mentioned in [Level 0](#level-0-basic-lambda-function-hosted-via-serverless) step 3. + +## Level 2: Basic Lambda Function automation via Basic Terraform with Local State** + +Terraform is an Infrastructure As Code (IaC) tool used to automate the provisioning of resources inside different SaaS solutions and Cloud providers. It uses HCL syntax, which is easy maintainable. The main problem of terraform is that you need to know, how everything works under the hood (e.g. IAM roles, policies, serverless platforms etc). + +**1. Repeat the 1st and 2nd step from Level 0** + +Create a slack bot, that sends a reminder to slack channel. Write integration tests for the application to ensure that each part of the application is functioning properly. + +**Note** Don't forget to add Lambda handler for the application + +**2. Automate the hosting via Terraform** + +**2.1 Write an IAM role with the least privilege principle for the lambda function and EventBridge.** + +**2.2 Automatically pack up the lambda function into a zip file** + +**2.3 Build the lambda function based on the zip file** + +**2.4 Build AWS Eventbridge, which will trigger the lambda function** + +**Note** Lambda function should be triggered every month on the 1st day of the month at 10:00 AM. + +At this level you can use local state for terraform, no modules needed to write. + +## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)** + +In a DevOps world, mostly we use remote state for terraform. The main reason is that we can share the state with other team members and we can easily manage the state of the infrastructure. Although it is a bit more complex to set up, it allows you to avoid issues when someone even removes the state file, cause S3 has versioning turned on. + +This level is more advanced, but more near to the real-world scenario. As a DevOps Engineer / SRE mostly all the terraform code is written in modules (or using community pre-built modules). Modules help us to maintain the codebase and reuse the code in different projects, so you don't need to write the same code again and again. + +**1. Repeat the steps from [Level 2](#level-2-basic-lambda-function-automation-via-basic-terraform-with-local-state)** + +Repeat all the steps from Level 2, but now you need to write a terraform module for the lambda function and EventBridge. Which means that instead of writing values directly into main.tf file, everything should be written using variables. For example: + +```tf +resource "aws_lambda_function" "slack_bot" { + function_name = var.function_name + role = var.role + handler = var.handler + runtime = var.runtime + timeout = var.timeout +} +``` + +We're using variables for each value, so we can reuse the module in different projects. + +**2. Use remote state for terraform** + +In this step you need to configure IAM User with least privilege principle for terraform to access S3 bucket, provision resources in Eventbridge and Lambda function. + +**Note** We would recommend using [Cloudformation](https://aws.amazon.com/cloudformation/) to create an IAM User with the least privilege principle + S3 Bucket for the remote state. Cloudformation can be applied via AWS CLI which means that everything persists to be AS CODE. + +**3. Use the S3 bucket for the remote state and module to provision the resources** + +Write your backend configuration to backend.tf file: + +```tf +terraform { + backend "s3" { + bucket = "" + key = "" + region = "" + encrypt = "" + } +} +``` + +Use the module written at step 1 to provision the resources + +```tf +module "slack_bot" { + source = "./modules/slack_bot" + function_name = "slack_bot" + role = "arn:aws:iam::123456789012:role/lambda-role" + handler = "main.handler" + runtime = "nodejs14.x" + timeout = 10 +} +``` + + +## Helpful commands + +- `serverless deploy` - Deploy the serverless application +- `aws cloudformation deploy --template-file template.yaml --stack-name my-stack` - Deploy the cloudformation stack +- `terraform init` - Initialize the terraform project and remote state. +- `terraform plan` - Plan the resources you're going to provision. It will show you the changes that will be made. +- `terraform apply` - Apply the terraform project only if you're sure that everything is correct during the plan. \ No newline at end of file diff --git a/subjects/devops/serverless/backend.tf b/subjects/devops/serverless/backend.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subjects/devops/serverless/cloudformation/.gitkeep b/subjects/devops/serverless/cloudformation/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subjects/devops/serverless/main.tf b/subjects/devops/serverless/main.tf new file mode 100644 index 0000000000..45f3691d28 --- /dev/null +++ b/subjects/devops/serverless/main.tf @@ -0,0 +1,3 @@ +module "aws_slack_bot" { + source = "./modules/aws_slack_bot" +} \ No newline at end of file diff --git a/subjects/devops/serverless/modules/aws_slack_bot/.gitkeep b/subjects/devops/serverless/modules/aws_slack_bot/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/subjects/devops/serverless/modules/aws_slack_bot/bot/.gitkeep b/subjects/devops/serverless/modules/aws_slack_bot/bot/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 From 3db381014480339a22167166529606de75657e5b Mon Sep 17 00:00:00 2001 From: KostLinux Date: Mon, 30 Sep 2024 20:23:49 +0300 Subject: [PATCH 2/6] fix: removed company names from folder and readmes --- .../devops/{luminor => basic-api}/README.md | 6 ++---- .../devops/{alpeso => notbad-task}/README.md | 10 ++-------- .../keycloak-test.tar.gz} | Bin .../{entain => game-task}/README.md | 6 +----- 4 files changed, 5 insertions(+), 17 deletions(-) rename employment-tasks/devops/{luminor => basic-api}/README.md (92%) rename employment-tasks/devops/{alpeso => notbad-task}/README.md (78%) rename employment-tasks/devops/{alpeso/alpeso-test.tar.gz => notbad-task/keycloak-test.tar.gz} (100%) rename employment-tasks/software-engineer/{entain => game-task}/README.md (94%) diff --git a/employment-tasks/devops/luminor/README.md b/employment-tasks/devops/basic-api/README.md similarity index 92% rename from employment-tasks/devops/luminor/README.md rename to employment-tasks/devops/basic-api/README.md index 0d82ced4a2..9df822d35f 100644 --- a/employment-tasks/devops/luminor/README.md +++ b/employment-tasks/devops/basic-api/README.md @@ -1,4 +1,4 @@ -# Luminor Test Task +# Site Reliability Engineer - Basic API Hosting Task ## Part 1 – The Web Service @@ -34,6 +34,4 @@ Deploy this application to your favourite cloud provider using Terraform. ## Part 3 – NewRelic -Implement NewRelic monitoring for this application using Terraform. - -Please send finished code, testing and results through mail. \ No newline at end of file +Implement NewRelic monitoring for this application using Terraform. \ No newline at end of file diff --git a/employment-tasks/devops/alpeso/README.md b/employment-tasks/devops/notbad-task/README.md similarity index 78% rename from employment-tasks/devops/alpeso/README.md rename to employment-tasks/devops/notbad-task/README.md index 92e25f87d6..9a8dae77a2 100644 --- a/employment-tasks/devops/alpeso/README.md +++ b/employment-tasks/devops/notbad-task/README.md @@ -1,13 +1,7 @@ -# Alpeso - -# Alpeso Recruiting - SENIOR DEVOPS ENGINEER - -This is a test project within Alpeso's technical recruiting process. +# Senior DevOps Engineer - NotBad Header based API Look at the following tasks and estimate how much time you will spend on them. -In doubt of technical issues you can send an e-mail with your questions. - ## Preconditions ### Technical & Knowledge @@ -22,7 +16,7 @@ You need at least: ## The tasks 1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. -2) You have the alpeso-test.tar.gz archive. What we can improve? +2) You have the keycloak-test.tar.gz archive. What we can improve? 3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. diff --git a/employment-tasks/devops/alpeso/alpeso-test.tar.gz b/employment-tasks/devops/notbad-task/keycloak-test.tar.gz similarity index 100% rename from employment-tasks/devops/alpeso/alpeso-test.tar.gz rename to employment-tasks/devops/notbad-task/keycloak-test.tar.gz diff --git a/employment-tasks/software-engineer/entain/README.md b/employment-tasks/software-engineer/game-task/README.md similarity index 94% rename from employment-tasks/software-engineer/entain/README.md rename to employment-tasks/software-engineer/game-task/README.md index 0d04ba74b1..7e75d0f256 100644 --- a/employment-tasks/software-engineer/entain/README.md +++ b/employment-tasks/software-engineer/game-task/README.md @@ -1,8 +1,4 @@ -# Entain - -Entain is one of the biggest companies, which hosts casinos like Olybet, Optibet etc. They are looking for a software engineer to join their team. - -## Task +## Software Engineer - Game Task ### Tools and technologies used: From d419f962cdae7ea6a4baead9e1556a4fc192cec7 Mon Sep 17 00:00:00 2001 From: KostLinux Date: Tue, 1 Oct 2024 12:37:06 +0300 Subject: [PATCH 3/6] fix: moved tar.gz to s3 bucket --- employment-tasks/devops/notbad-task/README.md | 11 ++++++++++- .../devops/notbad-task/keycloak-test.tar.gz | Bin 17152 -> 0 bytes 2 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 employment-tasks/devops/notbad-task/keycloak-test.tar.gz diff --git a/employment-tasks/devops/notbad-task/README.md b/employment-tasks/devops/notbad-task/README.md index 9a8dae77a2..7da5038ca7 100644 --- a/employment-tasks/devops/notbad-task/README.md +++ b/employment-tasks/devops/notbad-task/README.md @@ -16,7 +16,16 @@ You need at least: ## The tasks 1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. -2) You have the keycloak-test.tar.gz archive. What we can improve? +2) Get the keycloak-test.tar.gz archive. What we can improve? + +**2.1 Pull the archive from S3 bucket via `wget`** + +```bash +wget https://lookinlabs-contribution-data.s3.eu-west-1.amazonaws.com/keycloak-test.tar.gz +``` + +**2.2 Find what can be improved in `keycloak-test.tar.gz`** + 3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. diff --git a/employment-tasks/devops/notbad-task/keycloak-test.tar.gz b/employment-tasks/devops/notbad-task/keycloak-test.tar.gz deleted file mode 100644 index 1088eb56980516fcec3ad0704da907588953edf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17152 zcmZU)RZyKx*M^B(u;3cpgS)#!Ah>JLAi>jO&qPNa;6EB zqvlL<--n~q2?wq-YwLFItfJyenta#Y9(FVo*NC8qD9WK?N@~3Kf&-=!mr|0LpRo~N z!55wU?e+3}%U{}4+{Koxz4q5H0tR2YE&|k)Xz`^V(xc3u?LBcWMJOxLN@c5PR2RRt3(@$8>jyLQm9Kd$a(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IOMBj;cE>IJ9yUia;_y=kicdh%#<+0eUf1Ppn7edCa?zsa9 zW8!~60r_8&<1I=Yq;V-4i-)BU&r5PFBn70X7!0-eqv5C+3yynD-z4P!uw(zN5;*ez zZVjdIKP&%FjSiGA|A)np6aTd;Fvj`sKqSDo_#OFw+CwS)uMGE}0R9X4_#X`N&iT)( zz{rdsiT`xa!j^x|`QM8=wzwF$VYk%G~pFg4fo3E_6<(@fj?KtiIo)dqTUj6$M&kJ@R z__wb;(to?L_umiud%Jw-vsWg5{ZpxDub-&?qm;+w2O3^@{hjwN{?$)n8&1Av!{1K+ z#P^>)>-5Y1wd{v`XxBco@4L%iJoX2k-@edrUTn+brya56@2Bs3!wJvu7hX5wJLAk( zf7yF=a=dnkfb>6=BHK~g~et!Lr ze%pA^=MEN|ZrpZ(eA9j09)lO3pPqNyy{FX-f9s;pJp9j4i}B+_M!)i}`%j&*V1Dwe XyLu`daKHfvstW%P2qxPT02~4U8dIG~ From a76e0d2eb3e2bc731ccd15cb9a0712a0b21896d3 Mon Sep 17 00:00:00 2001 From: KostLinux Date: Tue, 8 Oct 2024 12:20:29 +0300 Subject: [PATCH 4/6] fix: unboxed the tar.gz, let the folder be open --- employment-tasks/devops/notbad-task/README.md | 11 +---------- .../devops/notbad-task/keycloak/.gitignore | 1 + .../devops/notbad-task/keycloak/README.md | 6 ++++++ .../devops/notbad-task/keycloak/keycloak.sh | 8 ++++++++ 4 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 employment-tasks/devops/notbad-task/keycloak/.gitignore create mode 100644 employment-tasks/devops/notbad-task/keycloak/README.md create mode 100755 employment-tasks/devops/notbad-task/keycloak/keycloak.sh diff --git a/employment-tasks/devops/notbad-task/README.md b/employment-tasks/devops/notbad-task/README.md index 7da5038ca7..4d7e27ab2b 100644 --- a/employment-tasks/devops/notbad-task/README.md +++ b/employment-tasks/devops/notbad-task/README.md @@ -16,16 +16,7 @@ You need at least: ## The tasks 1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. -2) Get the keycloak-test.tar.gz archive. What we can improve? - -**2.1 Pull the archive from S3 bucket via `wget`** - -```bash -wget https://lookinlabs-contribution-data.s3.eu-west-1.amazonaws.com/keycloak-test.tar.gz -``` - -**2.2 Find what can be improved in `keycloak-test.tar.gz`** - +2) Look into keycloak folder. What can be improved? 3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. diff --git a/employment-tasks/devops/notbad-task/keycloak/.gitignore b/employment-tasks/devops/notbad-task/keycloak/.gitignore new file mode 100644 index 0000000000..4c49bd78f1 --- /dev/null +++ b/employment-tasks/devops/notbad-task/keycloak/.gitignore @@ -0,0 +1 @@ +.env diff --git a/employment-tasks/devops/notbad-task/keycloak/README.md b/employment-tasks/devops/notbad-task/keycloak/README.md new file mode 100644 index 0000000000..5f63126e34 --- /dev/null +++ b/employment-tasks/devops/notbad-task/keycloak/README.md @@ -0,0 +1,6 @@ +# alpeso-test +alpeso-test + +## How-to use + +Simple run ```./keycloack.sh test test1``` where test = keycloak user id and test1 = keycloak client secret. diff --git a/employment-tasks/devops/notbad-task/keycloak/keycloak.sh b/employment-tasks/devops/notbad-task/keycloak/keycloak.sh new file mode 100755 index 0000000000..3eadf9ef50 --- /dev/null +++ b/employment-tasks/devops/notbad-task/keycloak/keycloak.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CLIENTID=$1 +CLIENTSECRET=$2 + +TOKEN=$(curl -k -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic $(echo -n ${CLIENTID}:${CLIENTSECRET} | base64 )" --data "grant_type=client_credentials" "http://mydomain.com/auth/realms/myrealm/protocol/openid-connect/token" -s | jq -r .access_token) + +echo $TOKEN From 2dbf65b6a32ae804a05dd061cff0f7e76f99788d Mon Sep 17 00:00:00 2001 From: KostLinux Date: Wed, 9 Oct 2024 19:20:25 +0300 Subject: [PATCH 5/6] fix: prettier linter --- employment-tasks/README.md | 2 +- employment-tasks/devops/basic-api/README.md | 17 +++++++------- employment-tasks/devops/notbad-task/README.md | 23 ++++++++++--------- .../devops/notbad-task/keycloak/README.md | 3 ++- .../software-engineer/game-task/README.md | 2 +- subjects/devops/serverless/README.md | 21 ++++++++--------- 6 files changed, 35 insertions(+), 33 deletions(-) diff --git a/employment-tasks/README.md b/employment-tasks/README.md index 9e4d54828c..8f652f27de 100644 --- a/employment-tasks/README.md +++ b/employment-tasks/README.md @@ -2,4 +2,4 @@ This folder is used to store test tasks from the real job interviews. The tasks are stored in the `test-tasks` folder. Each task is stored in a separate folder with the name of the company that provided the task. Inside the company folder, there is a `README.md` file with the task description. -The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack. \ No newline at end of file +The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack. diff --git a/employment-tasks/devops/basic-api/README.md b/employment-tasks/devops/basic-api/README.md index 9df822d35f..9732120959 100644 --- a/employment-tasks/devops/basic-api/README.md +++ b/employment-tasks/devops/basic-api/README.md @@ -7,15 +7,16 @@ some basic validation against an expected message format and content, and then puts that payload into a queue of your choice or a file. Example valid payload: + ```json { - "ts": "1530228282", - "sender": "curler-user", - "message": { - "foo": "bar", - "hash": "bash" - }, - "sent-from-ip": "1.2.3.4" + "ts": "1530228282", + "sender": "curler-user", + "message": { + "foo": "bar", + "hash": "bash" + }, + "sent-from-ip": "1.2.3.4" } ``` @@ -34,4 +35,4 @@ Deploy this application to your favourite cloud provider using Terraform. ## Part 3 – NewRelic -Implement NewRelic monitoring for this application using Terraform. \ No newline at end of file +Implement NewRelic monitoring for this application using Terraform. diff --git a/employment-tasks/devops/notbad-task/README.md b/employment-tasks/devops/notbad-task/README.md index 4d7e27ab2b..6b27d59b55 100644 --- a/employment-tasks/devops/notbad-task/README.md +++ b/employment-tasks/devops/notbad-task/README.md @@ -5,19 +5,20 @@ Look at the following tasks and estimate how much time you will spend on them. ## Preconditions ### Technical & Knowledge + You need at least: -* Experience with AWS stack -* Experience with CI/CD -* Experience with Bash scripts -* Experience in at least one programming language (Java, Python, PHP, Perl, etc.) -* A text editor of your choice +- Experience with AWS stack +- Experience with CI/CD +- Experience with Bash scripts +- Experience in at least one programming language (Java, Python, PHP, Perl, etc.) +- A text editor of your choice ## The tasks -1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. -2) Look into keycloak folder. What can be improved? - -3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". -Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. -Hint: https://aws.amazon.com/free/ \ No newline at end of file +1. We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this. + +2. Look into keycloak folder. What can be improved? +3. Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad". + Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them. + Hint: https://aws.amazon.com/free/ diff --git a/employment-tasks/devops/notbad-task/keycloak/README.md b/employment-tasks/devops/notbad-task/keycloak/README.md index 5f63126e34..58d7d2fc50 100644 --- a/employment-tasks/devops/notbad-task/keycloak/README.md +++ b/employment-tasks/devops/notbad-task/keycloak/README.md @@ -1,6 +1,7 @@ # alpeso-test + alpeso-test ## How-to use -Simple run ```./keycloack.sh test test1``` where test = keycloak user id and test1 = keycloak client secret. +Simple run `./keycloack.sh test test1` where test = keycloak user id and test1 = keycloak client secret. diff --git a/employment-tasks/software-engineer/game-task/README.md b/employment-tasks/software-engineer/game-task/README.md index 7e75d0f256..681cf067e6 100644 --- a/employment-tasks/software-engineer/game-task/README.md +++ b/employment-tasks/software-engineer/game-task/README.md @@ -63,4 +63,4 @@ This user has 50 amount of his balance for testing. 1. Create `.env` file in root folder and add all required variables from `.env.example` file 2. To run docker container you should have `docker` and `docker-compose` tools installed (Tested on `Docker version 26.1.3, build b72abbb` and `Docker Compose version v2.27.1`) 3. `docker-compose up` - to run application in docker container -4. `docker-compose down` - to stop application in docker container \ No newline at end of file +4. `docker-compose down` - to stop application in docker container diff --git a/subjects/devops/serverless/README.md b/subjects/devops/serverless/README.md index 0a54698896..296e9fc824 100644 --- a/subjects/devops/serverless/README.md +++ b/subjects/devops/serverless/README.md @@ -1,4 +1,4 @@ -## Serverless Payments Reminder +## Serverless Payments Reminder Serverless Payments Reminder is a basic Slack Bot that reminds companies / users to pay their bills. The reminder gets triggered by AWS EventBridge (also known as CloudWatch Events). The bot itself is hosted on a simple AWS Lambda function. @@ -15,7 +15,7 @@ Create a simple Slack bot using: The task is separated into multiple different levels. The levels are ordered by complexity. You can choose the level that you feel most comfortable with. -## Level 0: Basic Lambda Function hosted via Serverless** +## Level 0: Basic Lambda Function hosted via Serverless **1. Create Slack Bot** @@ -31,9 +31,9 @@ The environment variables which must be available in the Lambda function are: - `AMOUNT` - The amount to be paid - `IBAN_NUMBER` - The IBAN number -The due date must be calculated based on the current date for the next month. +The due date must be calculated based on the current date for the next month. -Before step two, you need to test that Slack Bot is functioning properly by running an application locally. It should send a message to the Slack channel. +Before step two, you need to test that Slack Bot is functioning properly by running an application locally. It should send a message to the Slack channel. **2. Write tests for the application** @@ -41,7 +41,7 @@ Write integration tests for the application to ensure that each part of the appl **3. Use [Serverless Framework](https://github.com/serverless/serverless) to host the lambda function** -Serverless framework is an automation tool used to deploy serverless applications which can help with event-driven architecture deployments. +Serverless framework is an automation tool used to deploy serverless applications which can help with event-driven architecture deployments. Use the serverless framework to host the lambda function combined with AWS Eventbridge. @@ -54,7 +54,7 @@ AWS Eventbridge should trigger lambda function every month on the 1st day of the **Note** Before hosting, you need to ensure that the bot is written in a way that it can be hosted on AWS Lambda. You can look at the example [here](https://github.com/KostLinux/aws-incident-manager-notifier/blob/56d52e90f8a14e689e7d2a1c7ee44590de5af2f5/main.go#L158). -## Level 1: Basic Lambda Function automation via Cloudformation** +## Level 1: Basic Lambda Function automation via Cloudformation **1. Repeat the 1st and 2nd step from Level 0** @@ -70,7 +70,7 @@ Cloudformation is Infrastructure As Code (IaC) tool used to automate the provisi Write cloudformation template with parameters (variables) `SlackWebhookUrl`, `Amount`, `IbanNumber`. The template should automatically provision the Slackbot based on architecture mentioned in [Level 0](#level-0-basic-lambda-function-hosted-via-serverless) step 3. -## Level 2: Basic Lambda Function automation via Basic Terraform with Local State** +## Level 2: Basic Lambda Function automation via Basic Terraform with Local State\*\* Terraform is an Infrastructure As Code (IaC) tool used to automate the provisioning of resources inside different SaaS solutions and Cloud providers. It uses HCL syntax, which is easy maintainable. The main problem of terraform is that you need to know, how everything works under the hood (e.g. IAM roles, policies, serverless platforms etc). @@ -94,7 +94,7 @@ Create a slack bot, that sends a reminder to slack channel. Write integration te At this level you can use local state for terraform, no modules needed to write. -## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)** +## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)\*\* In a DevOps world, mostly we use remote state for terraform. The main reason is that we can share the state with other team members and we can easily manage the state of the infrastructure. Although it is a bit more complex to set up, it allows you to avoid issues when someone even removes the state file, cause S3 has versioning turned on. @@ -137,7 +137,7 @@ terraform { } ``` -Use the module written at step 1 to provision the resources +Use the module written at step 1 to provision the resources ```tf module "slack_bot" { @@ -150,11 +150,10 @@ module "slack_bot" { } ``` - ## Helpful commands - `serverless deploy` - Deploy the serverless application - `aws cloudformation deploy --template-file template.yaml --stack-name my-stack` - Deploy the cloudformation stack - `terraform init` - Initialize the terraform project and remote state. - `terraform plan` - Plan the resources you're going to provision. It will show you the changes that will be made. -- `terraform apply` - Apply the terraform project only if you're sure that everything is correct during the plan. \ No newline at end of file +- `terraform apply` - Apply the terraform project only if you're sure that everything is correct during the plan. From ae53c1562f3b01004a1a22980b3c1b97aff69c05 Mon Sep 17 00:00:00 2001 From: KostLinux Date: Thu, 10 Oct 2024 14:08:34 +0300 Subject: [PATCH 6/6] fix: removed the linter issues --- subjects/devops/serverless/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subjects/devops/serverless/README.md b/subjects/devops/serverless/README.md index 296e9fc824..e7f06408e7 100644 --- a/subjects/devops/serverless/README.md +++ b/subjects/devops/serverless/README.md @@ -68,9 +68,9 @@ Cloudformation is Infrastructure As Code (IaC) tool used to automate the provisi **2.1 Hosting the Lambda function** -Write cloudformation template with parameters (variables) `SlackWebhookUrl`, `Amount`, `IbanNumber`. The template should automatically provision the Slackbot based on architecture mentioned in [Level 0](#level-0-basic-lambda-function-hosted-via-serverless) step 3. +Write cloudformation template with parameters (variables) `SlackWebhookUrl`, `Amount`, `IbanNumber`. The template should automatically provision the Slackbot based on architecture mentioned in Level 0 step 3. -## Level 2: Basic Lambda Function automation via Basic Terraform with Local State\*\* +## Level 2: Basic Lambda Function automation via Basic Terraform with Local State Terraform is an Infrastructure As Code (IaC) tool used to automate the provisioning of resources inside different SaaS solutions and Cloud providers. It uses HCL syntax, which is easy maintainable. The main problem of terraform is that you need to know, how everything works under the hood (e.g. IAM roles, policies, serverless platforms etc). @@ -94,13 +94,13 @@ Create a slack bot, that sends a reminder to slack channel. Write integration te At this level you can use local state for terraform, no modules needed to write. -## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)\*\* +## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced) In a DevOps world, mostly we use remote state for terraform. The main reason is that we can share the state with other team members and we can easily manage the state of the infrastructure. Although it is a bit more complex to set up, it allows you to avoid issues when someone even removes the state file, cause S3 has versioning turned on. This level is more advanced, but more near to the real-world scenario. As a DevOps Engineer / SRE mostly all the terraform code is written in modules (or using community pre-built modules). Modules help us to maintain the codebase and reuse the code in different projects, so you don't need to write the same code again and again. -**1. Repeat the steps from [Level 2](#level-2-basic-lambda-function-automation-via-basic-terraform-with-local-state)** +**1. Repeat the steps from Level 2** Repeat all the steps from Level 2, but now you need to write a terraform module for the lambda function and EventBridge. Which means that instead of writing values directly into main.tf file, everything should be written using variables. For example: