diff --git a/HW/HW2 Docker/flask/Dockerfile b/HW/HW2 Docker/flask/Dockerfile index bfcdcf6..5c13a86 100644 --- a/HW/HW2 Docker/flask/Dockerfile +++ b/HW/HW2 Docker/flask/Dockerfile @@ -16,15 +16,24 @@ COPY . /app # RUN pip install --no-cache-dir -r requirements.txt RUN pip install flask +ENV PORT=5002 + # Port 5000 is the default value for flask apps # Make port 5000 available to the world outside this container # Note that this is for the purposes of documentation # The port is actually exposed when you run the container from the command line -EXPOSE 5000 +EXPOSE $PORT # Run app.py when the container launches CMD ["python3", "app.py"] # Health check (checks every 30 seconds to see if the endpoint returns a successful response) # HEALTHCHECK --interval=30s --timeout=3s \ -# CMD curl -f http://localhost:5000/healthcheck || exit 1 \ No newline at end of file +# CMD curl -f http://localhost:5000/healthcheck || exit 1 + +# Health check (checks every 30 seconds to see if the endpoint +# returns a successful response) + +HEALTHCHECK --interval=30s --timeout=3s \ + +CMD curl -f http://localhost:${PORT}/healthcheck || exit 1 \ No newline at end of file diff --git a/HW/HW2 Docker/flask/agile.md b/HW/HW2 Docker/flask/agile.md new file mode 100644 index 0000000..07d6570 --- /dev/null +++ b/HW/HW2 Docker/flask/agile.md @@ -0,0 +1,23 @@ +1. Complete these user stories: +* As a vanilla git power-user that has never seen GiggleGit before, I want to… +understand what GiggleGit provides in respect to vanilla git and learn to use it efficiently. + +* As a team lead onboarding an experienced GiggleGit user, I want to… +quickly onboard my team and provide details on advanced GiggleGit features that will be used. + +2. Create a third user story, one task for this user story, and two associated tickets. +As a new user that has never used GiggleGit nor vanilla Git, I want to easily navigate through the important documentations to get started. + +* task: increase accessibility and decrease complexity of navigation + +* ticket 1: Implement in-page hyperlinks in documentation +add links on important keywords that will take the user to relevant information + +* ticket 2: prominant "getting started" section in the homepage +add a clearly visible and easily accessible "Getting Started" section on the homepage that directs new users to the documentation for setting up and using GiggleGit. + + +3. This is not a user story. Why not? What is it? +this is not a user story because the story is extremely vague: it doesn't tell me what kind of user it is, and doesn't give me an idea of why they want to able to authenticate on a new machine. + +this is more of a request for a feature/benefit. \ No newline at end of file diff --git a/HW/HW2 Docker/flask/app.py b/HW/HW2 Docker/flask/app.py index fdc062e..4566b1b 100644 --- a/HW/HW2 Docker/flask/app.py +++ b/HW/HW2 Docker/flask/app.py @@ -1,4 +1,5 @@ -from flask import Flask, make_response +from flask import Flask, make_response, request +import os app = Flask(__name__) @@ -12,8 +13,37 @@ def hello(): ) return response +@app.route('/repeat', methods=['GET']) +def repeat(): + input= request.args.get('input','') + response = make_response( + { + 'body': input, + 'status': 200 + } + ) + return response + +@app.route('/health') +@app.route('/healthcheck') +def health(): + response = make_response( + { + 'body': 'OK', + 'status': 200 + } + ) + return response + +@app.route('/hang') +def hang(): + while True: + pass + if __name__ == '__main__': # By default flask is only accessible from localhost. # Set this to '0.0.0.0' to make it accessible from any IP address # on your network (not recommended for production use) - app.run(host='0.0.0.0', debug=True) + + PORT =os.getenv("PORT") + app.run(host='0.0.0.0', port = PORT, debug=True, threaded=False) diff --git a/HW/HW2 Docker/flask/formalrequirements.md b/HW/HW2 Docker/flask/formalrequirements.md new file mode 100644 index 0000000..c493bb9 --- /dev/null +++ b/HW/HW2 Docker/flask/formalrequirements.md @@ -0,0 +1,11 @@ +1. goal: develop a sync interface compatible with base GiggleGit packages so that when a user sync their code a humorous message would generate + +2. nongoal: incorporate ai or somesort of api to create messages/audios/videos/images when syncing. + +* nonfunctional requirement 1: Security +- functional requirement 1: data and information about the user should be encrypted and secured +- functional requirement 2: feature does not have customization/manipulation, ensuring consistentcy + +* nonfunctional requirement 2: Non-Repeatability +- functional requirement 1: use database to store previous messages, a user should not obtain the same message more than once per 3 days +- functional requirement 2: messages build off of one another/tailored to a user humor