{"id":23126350,"url":"https://github.com/sdatko/flask-container-ci2","last_synced_at":"2026-05-05T14:04:58.764Z","repository":{"id":149691365,"uuid":"234932920","full_name":"sdatko/flask-container-ci2","owner":"sdatko","description":"This repository contains my solution for `flask_container_ci2` exercise from Arie Bregman's `devops-exercises` project.","archived":false,"fork":false,"pushed_at":"2021-11-23T12:04:23.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T16:42:51.046Z","etag":null,"topics":["bash","docker","flask","pytest","python","tox","unittest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdatko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-19T16:51:58.000Z","updated_at":"2020-01-24T08:38:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"d57e82c1-81bb-4201-b6e5-aae5ff6a6589","html_url":"https://github.com/sdatko/flask-container-ci2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdatko%2Fflask-container-ci2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdatko%2Fflask-container-ci2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdatko%2Fflask-container-ci2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdatko%2Fflask-container-ci2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdatko","download_url":"https://codeload.github.com/sdatko/flask-container-ci2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247124758,"owners_count":20887560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","docker","flask","pytest","python","tox","unittest"],"created_at":"2024-12-17T08:29:33.597Z","updated_at":"2025-10-04T14:19:34.443Z","avatar_url":"https://github.com/sdatko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/sdatko/flask-container-ci2/workflows/CI/badge.svg)\n\nYour mission, should you choose to accept it, involves developing an app, containerize it and set up a CI for it.\nPlease read carefully all the instructions.\n\nIf any of the following steps is not working, it is expected from you to fix them.\n\n## Installation\n\n1. Create a virtual environment with `python3 -m venv challenge_venv`.\n2. Activate it with `source challenge_venv/bin/activate`.\n3. Install the requirements in this directory `pip install -r requirements.txt`.\n\n## Run the app\n\n1. Move to `exercises/flask_container_ci2` directory, if you are not already there.\n2. Run `export FLASK_APP=app/main.py`.\n3. To run the app execute `flask run`. If it doesn't works, fix it.\n4. Access `http://127.0.0.1:5000`. You should see the following:\n\n```\n{\n    \"current_uri\": \"/\",\n    \"example\": \"/matrix/'123n456n789'\",\n    \"resources\": {\n        \"column\": \"/columns/\u003cmatrix\u003e/\u003ccolumn_number\u003e\",\n        \"matrix\": \"/matrix/\u003cmatrix\u003e\",\n        \"row\": \"/rows/\u003cmatrix\u003e/\u003crow_number\u003e\"\n    }\n}\n```\n\n4. You should be able to access any of the resources and get the following data:\n\n* `/matrix/\u003cmatrix\u003e`\n\n    for example, for `/matrix/123n456n789` the user will get:\n\n    ```\n    1 2 3\n    4 5 6\n    7 8 9\n    ```\n\n* `/columns/\u003cmatrix\u003e/\u003ccolumn_number\u003e`\n\n    for example, for `/columns/123n456n789/2` the user will get:\n\n    ```\n    2\n    5\n    8\n    ```\n\n* `/rows/\u003cmatrix\u003e/\u003crow_number\u003e`\n\n    for example, for `/rows/123n456n789/1` the user will get:\n\n    ```\n    1 2 3\n    ```\n\n## Containers\n\nUsing Docker or Podman, containerize the flask app so users can run the following two commands:\n\n```\ndocker build -t app:latest /path/to/directory-containing-Dockerfile\ndocker run -d -p 5000:5000 app\n```\n\n1. You can use any image base you would like.\n2. Containerize only what you need for running the application, nothing else.\n\n## CI\n\nGreat, now that we have a working app and also can run it in a container, let's set up a CI for it so it won't break again in the future.\nIn current directory you have a file called tests.py which includes the tests for the app. What is required from you, is:\n\n1. Write a CI pipeline that will run the app tests. You are free to choose whatever CI system or service you prefer. Use `python tests.py` for running the tests.\n2. There should be some kind of test for the Dockerfile you wrote.\n3. Add additional unit test (or any other level of tests) for testing the app.\n\n### Guidelines\n\n* Except the app functionality, you can change whatever you want - structure, tooling, libraries, ... If possible, add `notes.md` file which explains reasons, logic, thoughts and anything else you would like to share.\n* The CI part should include the source code for the pipeline definition.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdatko%2Fflask-container-ci2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdatko%2Fflask-container-ci2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdatko%2Fflask-container-ci2/lists"}