COSC2759

100 views 5:36 am 0 Comments August 29, 2023

COSC2759 Assignment 2 Specifications Deadline % allocated to this assignment To be submitted via To be attempted Scenario Sunday 21 May, 2023 (11:59 pm AEST) 45% (to be marked out of 100) GitHub & Canvas Individually You have been assigned the following “story” on Jira: AS A developer at Alpine Inc, I WANT an automated deployment process for our Foo app, including infrastructure, SO THAT we can avoid human errors during the deployment process. Acceptance criteria: GIVEN credentials for an AWS environment, and a docker image already built and hosted in an image registry, WHEN we run the deployment script in the repo (or, ideally, when a GitHub Actions workflow runs), THEN we get the infrastructure we need, with the application running on it. (For this “user story” format, see https://medium.com/@cash.lebrun/the-right-way-to-write-a-user-story-9626011c1b57) So far, Alpine Inc’s production infrastructure and application deployments are managed through ClickOps, which is prone to human error. They would like you to have a look at how to automate the infrastructure and application deployment. The Foo app is a nodejs web app with a PostgreSQL database backend. The dev team has built the app’s docker image and hosted it at patrmitacr.azurecr.io/assignment2app (note: this is a docker pull URL, not a web address). They would like you to deploy this application to EC2. The current deployment process is described in how-to-deploy.txt in the starter repo. When running correctly, the UI of the Foo app looks like this: Ideally they would like to achieve greater resiliency and automation, but as a minimum they need an automated process to get the app container and its database running on an EC2 instance. More details can be found in the ‘Deliverable’ section below. The Approach Alpine Inc’s CTO (Chief Technology Officer) has prescribed the following tools for use in this project: • • • • • • GitHub (GitHub Classroom) GitHub Actions – used for creating the pipelines Terraform Ansible AWS Docker You may justified in your README.md. use additional tools, libraries, etc as long as their inclusion is explained and Access GitHub Classroom We will be using GitHub classroom to edit and manage the code base. You will be supplied with a “starter repo” containing the app source code. As in assignment 1, Github Classrooms will create a “student repo” for you, where you will add content such as Terraform configs and the README file. The GitHub Classrooms invitation link is: https://classroom.github.com/a/nXq-6OIl Please see the appendix to this spec for instructions on how to use GitHub Classrooms. Deliverables You are given a copy of the Foo app repo (the “student repo” that GitHub Classroom creates for you). Alpine Inc expects you to update this repo with the scripts and other files required for your solution. Whatever you put in your repo should be explained by your README.md. Note that the `how-to-deploy.txt` file might not contain all the details you need. You may need to fill in some gaps using your judgment. Please use your README.md file to explain and justify your decisions. Note: see the assignment rubric for additional details; the rubric is what your marks will be based on. Section A 1. InREADME.md,describeandjustifyyoursolution,includingappropriateuseof diagrams (e.g. process diagram and infrastructure architecture diagram). (20%) a. Note: As you proceed through sections A-D, you should update your README file to cover your whole solution, not just your solution for section A. 2. UseTerraformtodeploytherequiredinfrastructuree.g.EC2instance(s).(10%) 3. UseAnsibletoconfiguretheEC2instance(s)toruntheappanddatabase containers. (10%) 4. Writeashellscripttodeploytheinfrastructureandruntheapplicationonit.(10%) Section B 5. Toimprovetheresiliencyoftheapplication,deploytheappcontainerontwo identical EC2 instances behind a load balancer, with the database running on a separate EC2 instance. (10%) Section C 6. InyourTerraformconfiguration,useanS3bucketremotebackendforstate.(10%) a. Note: You can clickops the state bucket (it is fairly normal in industry to clickops the state bucket) or you can use the Terraform configuration in `misc/state-bucket-infra.tf` (separate from your main Terraform configuration). b. Note #2: Don’t get the Terraform configurations mixed up. You can’t deploy the state bucket with the configuration that is using the state bucket. If this last point is too confusing, just clickops the state bucket and ignore `state-bucket-infra.tf`. 🙂 Section D Note: If you attempt this part of this assignment, also include a standalone deployment script as per “Section A”. (The CTO wants to “avoid vendor lock-in”.) 7. CreateaGitHubActionsworkflowwhichdeploystheinfrastructureandrunsthe application on it. (10%) 8. MaketheGitHubActionsworkflowrunwheneverthe`main`branchismodified, and also able to be triggered via the GitHub Actions REST API. (10%) 9. Ensurethatiftheinfrastructureisalreadydeployedintheenvironment,then re-running the workflow is a no-op. (10%) Plagiarism All assignments will be checked with plagiarism-detection software; any student found to have plagiarized would be subject to disciplinary action. Plagiarism includes: ● CONTRACT CHEATING: paying someone to do your work ● CONTRACT CHEATING: getting someone else to write the test or attend demo ● submitting work that is not your own or submitting text that is not your own ● copying work from/of previous/current semester students ● allowing others to copy your work via email, printouts, social media etc. ● posting assignment questions (in full or partial) on external technical forums ● sending or passing your work to your friends ● posting assignment questions on technical forums to get them solved. A disciplinary action can lead to: ● a meeting with the disciplinary committee ● a score of zero for the assignment ● a permanent record of copying in your personal university records and/or ● expulsion from the university, in some severe cases All plagiarism will be penalised. There are no exceptions and no excuses. You have been warned. For more details please read RMIT’s page on Academic Integrity at https://www.rmit.edu.au/students/student-essentials/assessment-and-exams/academi c-integrity Note regarding generative AI: For the purpose of this course, you can use ChatGPT as you would a search engine, to show you examples or direct you to other sources of information. However you cannot copy text from ChatGPT (or other AI tools) into your assessment. The work you submit has to be your own work. See also https://rmit.libguides.com/referencing_AI_tools. Submission Procedure Submit your assignment by using the Website URL submission option: ● Website URL: the URL of a diff between the tip of your main branch and the initial commit in your repo, formatted like https://github.com/rmit-computing-technologies/cosc2759-assignment-2-<your github username>/compare/aaabbbb…main (where `aaabbbb` is the commit SHA of the initial commit). o You’ll need to change the repo name and base commit SHA. o This will show a list of your commits on `main` and a summary of the changes you’ve made. Providing this link makes it easier for our tutors to mark your assignment, because they can see your work (vs the template). It is also good practice for how to show people your changes in the workplace. ● Comment should be: Your full name and Student ID Late submissions and extension-related information A penalty of 10% per day of the total marks for each assignment will apply for each day a submission is late, including both weekdays and the weekend. After 5 days, you will receive zero marks for that assignment. All extension requests must be submitted via ‘Assessment Extensions’ tool accessible via Course Canvas. The deadline for submitting an extension request is 24 hours prior to the assessment deadline. Appendix – How to access GitHub Classroom We will be using Github classroom to edit and manage the code base. All the core files for the application will be provided to you here. Note: The instructions below have screenshots from assignment 1, but the process is the same for assignment 2. 1. Jointheclassroomwiththeinvitelink(seebodyoftheassignmentspecabove) and login with your Github account. 2. Chooseyourstudentnumberfromthelistyouareshown. 3. Clickonthe“Accepttheassignment”button 4. Afteryouaccepttheinvitation,waituntiltheprocessisdone. 5. Clickonthelinktogotoyournewlycreatedrepository 6. Youwillbetakentoyournewrepository.Clickthecodebuttonandclonethis repo to your local machine to start working.

Tags: , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *