ilanasufrin / nyu-devops-homework-1 Goto Github PK
View Code? Open in Web Editor NEWFirst homework assignment for the NYU devops class
License: Apache License 2.0
First homework assignment for the NYU devops class
License: Apache License 2.0
As a developer
I need to create a python file to automate unit testing of icecream.py
So that the application can be tested automatically
Acceptance Criteria
The python test file should successfully test all cases in icecream.py
As a user
I want to create a free account on Travis CI
So that I can run tests continuously
As a developer
I want to push the application to Bluemix
So that I can visit an external URL and see the running application properly
Acceptance Criteria
I want to be able to visit a URL
And see the running application
This includes QAing all the methods
Hint: use cf push
As a user
I want to see my information whenever I use the API
So that I can get consistent data
Notes: use redis
In Part 1 you will package your existing code to run in a Docker container. Then you will deploy that Docker container into the Bluemix Container Cloud. This homework requires that you use some type of persistent storage so that your application survives a restart. Make sure that any 3rd party services like Redis get bound to the container so that it continues to work properly. You want to take advantage of the horizontal scaling capabilities of the cloud so be sure to deploy a Container Group and not just an individual container.
You will need to:
Add persistent storage to your application if you haven't already. Docker containers must keep all state external. Redis is fine for storing Python dictionary collections. It doesn't have to be a fancy database, it just has to survive a container restart.
Create a Dockerfile to build your image
Create a container from your image and test it locally
Push your image to the Bluemix Docker Registry using the cf ic (Cloud Foundry IBM Containers) command line interface
Create a Container Group to run at least 2 instances of your containers
Make sure the Container Group is bound to any Services you are using (e.g. Redis)
Hit the URL of your new service and make sure that it works (it can be the same URL if you delete your Cloud Foundry app or a new URL. It's your choice)
Write Stories (as Github Issues) to plan the work needed to create the Dockerfile and add them to your Backlog.
Conduct a Sprint Planning meeting to discuss the Backlog and order the Stories by priority.
Set up your Milestones and Burndown chart so that you can track your progress. Create 2 sprints to do this.
Move these Stories through the ZenHub pipeline as you work on them just like you did in homework 1
What I am looking for here is a working service that is running on Bluemix as a scalable container group. I also want to see the Dockerfile is using Best practices for writing Dockerfiles
Please submit the URL of your group's service running in Bluemix to complete Part 1 of this homework.
As a developer
I need to create a service
So that someone can melt of freeze an ice cream flavor
Acceptance Criteria:
When I vagrant up
I should be able to decide to melt or freeze an ice cream flavor based personal preference
As a developer
I need to create TDD testcases
So that developers can perform unit testing for all required scenario
Acceptance Criteria:
When I run the testcases
All the testcases should pass
As a developer
I want to set up the DevOps Pipeline in Bluemix to build and deploy the project when the master branch changes
So that I can see if the tests are failing remotely
As a developer,
I want to create manifest.yml
, Procfile
, and runtime.txt
files
So that Bluemix will know how to deploy my application
Acceptance Criteria
Please list_all_ice_creams and get_popular_ice_cream have redundant method signatures which is causing an error in testing. Please combine these two methods so this error no longer exists. I believe Soumie worked on this so please fix this
As a User
I need a way to list the ice creams based on popularity
So that I can easily view the popular ice-creams
Assumptions:
URL should return a list of ice cream flavors
Acceptance Criteria:
When I call the URL /ice-cream?popularity=4
It should return a list of ice cream flavors with popularity greater than or equal to 4.0
As a user I want to hit the URL of the new service and test
so that I know it works.
Acceptance Criteria
Hit the URL of your new service and make sure that it works (it can be the same URL if you delete your Cloud Foundry app or a new URL. It's your choice)
As a User
I need the ability to add new ice cream flavor
So that I can introduce new flavors to my customer
Assumptions:
Acceptance Criteria:
This includes creating the relevant files
Most routes in our icecreams.py
file go to @app.route('/ice-creams/<id>', methods=['DELETE'])
Some of them to go @app.route('/flavors/<something else>',
Please change flavors
to ice-creams
As a developer
I need to create a RESTful way to update an ice cream flavor resource
So that my team members can update an ice cream flavor resource
Acceptance Criteria
After I SSH using the Vagrant file
I can update an ice cream flavor in a RESTful way
As a developer
I need to update the Vagrantfile with port forwarding for Flask
So that the application can be tested locally
Acceptance Criteria
The Vagrant file should contain
config.vm.network "forwarded_port", guest: 5000, host: 5000
As a developer
I want to add the Cloud Foundry CLI to the Vagrantfile
So that my team members can easily get up and running with Cloud Foundry
Acceptance Criteria
As a developer
I want to use Docker inside of Vagrant
So that I can install 3rd-party services (like a database) inside of the container
(I also want to pick which database we're using)
Acceptance Criteria
When I go to install the project
I should see a database being installed via Docker
As a developer
When I store ice cream data in Redis
The index of the ice cream should be a numeric ID (not the name
that it's currently stored by)
So that I can follow best practices
As a developer
I need to create a .py file which contains all resource definitions of the ice-cream API
So that my team members can reuse the file to implement the stories
Assumptions:
Only method definitions are provided
definitions can be changed during implementation
As a developer
I need to create a RESTful way to query an ice cream flavor by some attribute of an ice cream flavor resource
So that my team members can query an ice cream flavor by some attribute of an ice cream flavor resource
Acceptance Criteria
After I SSH using the Vagrant file
I can query an ice cream flavor by some attribute of an ice cream flavor resource
As a developer
I need to create a BDD testcase
So that the action feature can be tested
Acceptance Criteria:
When I run the command behave
the testcase should pass
As a User
I need a way to keep track of the list of ice creams
So that I can easily view the complete list of ice creams
Assumptions:
Add a URL of /ice-creams
URL should return a list of ice creams
In memory persistence is fine for MVP
Acceptance Criteria:
When I call the URL /ice-creams
It should return a list of ice creams as a JSON string.
As a developer
I need to create a RESTful service
So that developers can delete resources in the database
Acceptance Criteria:
When I vagrant up
I should be able to delete an ice cream flavor
As a developer
I want to create and configure a travis.yml
file
So that I can run test cases every time somebody pushes to the master branch,
As a developer
I want to create a Cloud Foundry application
So that I can deploy my application to IBM's Bluemix
Acceptance Criteria
When I go to the Bluemix website
Then I should see a running Bluemix application
And I should share the SDK with my other team members
In Part 3 you will add a DevOps Pipeline to deploy your service automatically. It should also run your tests from Part 2 every time the master branch is updated and every time someone submits a Pull Request. The Pull Request will tell you if all of the tests have passed and you should NOT accept a Pull Request with tests that are failing. This will ensure that the master branch is always deployable.
You will need to:
Create a free account on Travis CI.
Create a .travis.yml file and configure Travis CI to run test cases every time someone pushes to the master branch or submits a Pull Request.
Set up Travis CI to monitor your GitHub repository for push and pull requests.
Set up the DevOps Pipeline in Bluemix to build and deploy your project when the master branch changes.
Connect this DevOps pipeline to the GitHub repository for your project
Add a Test Stage to the pipeline to run your integration tests
Write Stories (as Github Issues) to plan the work needed to create the necessary integrations and add them to your Backlog.
Move these Stories through the ZenHub pipeline as you work on them just like you did in homework 1
(optional) Integrate your Pull Requests with your Slack channel so that any time someone makes a pull request, the channel is notified so someone can approve it.
As a developer
I need to add .vagrant to the file .gitignore
So that the .vagrant folder is not checked into git
Acceptance Criteria
The .gitignore file should contain the entry -
.vagrant\
As a developer
I want to set up Travis CI to monitor my GitHub repo for push and pull requests
So that I can make sure my tests aren't failing.
As a developer
I need to create a BDD testcase
So that the query feature can be tested
Acceptance Criteria:
When I run the command behave
the testcase should pass
As a developer
I need to update the vagrant file
So that other developers can run vagrant up
&& vagrant ssh
and be able to start developing
Acceptance Criteria
When I view the project in Zenhub
I should be able to vagrant up to get the service running locally
As a developer
I need to create a vagrantfile
So that my team members can easily get started with the project
Acceptance Criteria
When I go to the Github project
I should see a vagrantfile
Hey
As a developer
I need to create a RESTful way to fetch an ice-cream using the name
So that my team members can query an ice cream flavor by a name
Acceptance Criteria
When I call the URL /ice-creams/Vanilla
It should return the data containing ice-cream name = Vanilla
In Part 2 we will need a test suite that runs anytime a change is pushed to the master branch on GitHub. This will be the gate in our DevOps Pipeline to merging Pull Requests in Part 3.
You will need to:
Create a BDD .feature file and accompanying .steps file to test your RESTful API from the outside in.
Write the feature using Gherkin syntax that is understood by the behave tool
There should be at least 7 Scenarios in the feature file, one for each of Create, Read, Update, Delete, List, Query, Action
Run these using behave until all scenarios are green (passing)
Create a TDD test_???.py that contains your Unit Tests using PyUnit to test your application from the inside out.
Decide whether you want to use the standard PyUnit syntax or RSpec syntax. The choice is up to you. You only need to use one or the other.
Run these tests using nosetest until they are all green (passing)
Use the coverage tool to measure your test coverage. Your goal is get it above 90% for full credit.
Write Stories (as Github Issues) to plan the work needed to create the test cases and add them to your Backlog.
Move these Stories through the ZenHub pipeline as you work on them just like you did in homework 1
What I am looking for is a demonstration of your understanding of how write good test cases and feature scenarios. I am also looking for good code testing coverage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.