diff --git a/04 Lab 3 Profiling and Documentation.md b/04 Lab 3 Profiling and Documentation.md index 053fbb6..d9063b5 100644 --- a/04 Lab 3 Profiling and Documentation.md +++ b/04 Lab 3 Profiling and Documentation.md @@ -3,18 +3,22 @@ Resources: -1. [Lecture slides](https://docs.google.com/presentation/d/1takMoPNZTk4IyfqrEssDm9yFfkQQxuA16ZBoohUso80/edit?usp=sharing) +1. [Lecture slides](https://drive.google.com/open?id=1takMoPNZTk4IyfqrEssDm9yFfkQQxuA16ZBoohUso80) ## 1 Profiling NodeJS includes the **Tick Profiler**, a native tool, which allows you to profile your NodeJS code. It is activated using the `--prof` flag, eg: + ```shell $ node --prof index.js ``` + This will capture data on the performance but, in a development environment this will need to be simulated using the [Apache Bench](https://httpd.apache.org/docs/2.4/programs/ab.html) tool, eg: + ```shell $ ab -k -c 20 -n 250 "http://localhost:8080" ``` + You will note that there are three flags used: 1. `-k` - **KeepAlive** - perform multiple requests using the same session. @@ -25,7 +29,8 @@ Apache Bench generates a range of useful data however we need more information t ## The Tick File -by using the `--prof` flag, NodeJS generates a _tick file_ in the current directory with the name ` isolate-0xnnnnnnnnnnnn-v8.log`, where nnn... is a number. This file needs to be interpreted using a _tick interpreter_ and the analysis piped to a text file which can then be opened and read. +by using the `--prof` flag, NodeJS generates a _tick file_ in the current directory with the name `isolate-0xnnnnnnnnnnnn-v8.log`, where nnn... is a number. This file needs to be interpreted using a _tick interpreter_ and the analysis piped to a text file which can then be opened and read. + ```shell $ node -prof-process isolate-0xnnnnnnnnnnnn-v8.log > processes.txt ``` diff --git a/05 Lab 1 Docker and Deployment.md b/05 Lab 1 Docker and Deployment.md index 435eaa8..ea97b54 100644 --- a/05 Lab 1 Docker and Deployment.md +++ b/05 Lab 1 Docker and Deployment.md @@ -157,4 +157,16 @@ $ heroku run bash ### 6.1 Deploying Directly From GitHub -https://medium.freecodecamp.org/how-to-deploy-a-nodejs-app-to-heroku-from-github-without-installing-heroku-on-your-machine-433bec770efe +There is an alternative approach which is to deploy directly from GitHub. This process can be triggered by pushing commits to your repository. There is a very easy to follow [tutorial](https://medium.freecodecamp.org/how-to-deploy-a-nodejs-app-to-heroku-from-github-without-installing-heroku-on-your-machine-433bec770efe) that covers this step by step. + +## 7 Deploying Using the DPL Tool + +The [DPL tool](https://github.com/travis-ci/dpl) was originally developed for use in the [Travis](https://travis-ci.org) CI tool but can be employed as a general purpose deployment tool and works well with Heroku. + +The DPL tool is written in the [Ruby](https://www.ruby-lang.org/en/) programming language so you need to install a couple of ruby tools first and use these to install the `dpl` tool. + +```shell +apt-get install -y ruby ruby-dev rubygems-integration +gem install dpl +dpl --provider=heroku --app=johndoe-dpl --api-key=95023c27-5a9d-4250-a3fd-d2e19e0dac02 +``` diff --git a/05 Lab 2 Continuous Delivery.md b/05 Lab 2 Continuous Delivery.md index 855ac0b..263692d 100644 --- a/05 Lab 2 Continuous Delivery.md +++ b/05 Lab 2 Continuous Delivery.md @@ -2,7 +2,18 @@ # Continuous Delivery -In this lab you will learn how to implement Continuous Delivery of your application using the CodeShip cloud service. +In this lab you will learn how to implement Continuous Delivery of your application using two different services: + +1. [GitLab](https://gitlab.com) provides an integrated CI/CD DevOps pipeline which makes use of Docker containers and is simple to configure. +2. [CodeShip](https://codeship.com) is example of Software as a Service (SaaS) and integrates with GitHub via an authentication token. + +Resources: + +1. [Lecture slides](https://drive.google.com/open?id=1b00JkdBlx05DjDrWKwZdJtzHbJR7Nstfw4_vUR9StBE) +2. [Starting and Scaling DevOps in the Enterprise (e-book)](https://page.gitlab.com/rs/194-VVC-221/images/Starting%20and%20Scaling%20DevOps%20in%20the%20Enterprise.pdf) +3. [Simple authentication API](https://gitlab.com/covcom/authentication) + +Feel free to make use of the simple authentication API in your assignment, this will allow you to focus on building the core functionality. Be aware you will need to modify it to get it to integrate into the rest of your project. ## CodeShip CI @@ -40,10 +51,7 @@ Paste in the GitHub url where requested and, on the next screen select **Basic p On the **Configure your tests** screen choose **NodeJS** from the dropdown list and delete all the commands from the list except `npm install`. -Resources: - -1. [Lecture slides](https://drive.google.com/open?id=1b00JkdBlx05DjDrWKwZdJtzHbJR7Nstfw4_vUR9StBE) -2. [Starting and Scaling DevOps in the Enterprise (e-book)](https://page.gitlab.com/rs/194-VVC-221/images/Starting%20and%20Scaling%20DevOps%20in%20the%20Enterprise.pdf) +-------- Each week you will be expected to complete a series of lab activities. You will be required to reflect on these in your assignment so make sure you keep records of what you have done. This lab will include your third sprint and will bring together many of the topics already covered.