Handling SOAJS image updates & upgrades and updating the services
Objective
Become familiar with how the SOAJS Dashboard notifies you about SOAJS image updates & upgrades and learn how to pull and apply them and apply them on services deployed in the Dashboard Environment.
Steps
- Locate Update Notifications
- Understand what the Update is about
- Apply the Code Update
- Deployer Modified
- Core Modified
- Both Deployer and Code were Modified
- Other Image Updates
Step 1
The Dashboard contains a notification system that informs you whenever new image updates or upgrades are published by the SOAJS team.
These notifications appear Under Deploy pillar → Updates & Upgrades.
In Updates & Upgrades you will see notifications about new image updates or upgrades with a link so you can learn more about them.
Step 2
SOAJS images are published on Docker Hub and are categories as follows:
- Framework: https://hub.docker.com/r/soajsorg/soajs/
- Nginx: https://hub.docker.com/r/soajsorg/nginx/
- Analytics
All the images are tagged based on Release Names & the version of the SOAJS deployer they are using EXCEPT the Framework; The Framework has 2 versions associated with it ( explained below ).
EX:
Nginx Image release on May 16, 2017 was part of the whiteshark release thus the image tags are: whiteshark and 1.0.x
You can pull that image by running any of the two commands:
# pull the image based on tag name as a release > docker pull soajsorg/nginx@whiteshark # pull the image based on tag name as a version > docker pull soajsorg/nginx@1.0.x
Reference: https://hub.docker.com/r/soajsorg/nginx/tags/
Framework Images
The framework images are also tagged based on the release name but when it comes to the version, the tag is made up of 2 versions: deployer & core
Deployer | The deployer version that was used in this image | https://github.com/antoinehage/soajs.buildImages |
---|---|---|
Core | The SOAJS Core Framework version that was used in this image | https://github.com/soajs/soajs |
Depending on the update type, either the deployer gets updated or the framework or even both.
The deployer updates affects the catalog recipes as they may contain changes in the command to run. The catalog recipe command invokes a functionality in the deployer, if the deployer functionality changes then the image needs to be updated to cater for this change thus the version of the image is bumped.
The core framework updates affects the services that were built on top of this framework and are using this core version. After the deployer runs an NPM install command and after pulling the service code, the service will require the core framework to launch. If the version of that framework is incompatible with the one that the service requires, the service will crash thus the version of the image is bumped.
The framework version is therefore constructed as follow: 1.0.x-1.0.x
- The first 3 digits represent the version of the deployer that was using in this image
- The second 3 digits represent the version of the SOAJS core framework that was using in this image
Step 3
Once you lookup the new image updates and understand how they will affect the services you have deployed, you can proceed with applying that update.
Updating Framework Image
Check out the image version on docker: https://hub.docker.com/r/soajsorg/soajs/tags/
Case 1: Deployer was Modified
- Read about the new command updates under Catalog Recipes and learn what has changed in the deployer
- Open Catalog Recipes in SOAJS Console and modify the recipes accordingly
- run the docker pull command in your terminal as instructed in Step 2 above
- Go to Deploy pillar → Clouds & Deployments
- Lookup the service you want to update
- Open the Service Operations menu
- Click Redeploy Service
Case 2: SOAJS Core was Modified
- run the docker pull command in your terminal as instructed in Step 2 above
- Go to Deploy pillar → Clouds & Deployments
- Lookup the service you want to update
- Open the Service Operations menu
- Click Restart Service
Case 3: both Deployer and SOAJS Core were Modified
- Read about the new command updates under Catalog Recipes and learn what has changed in the deployer
- Open Catalog Recipes in SOAJS Console and modify the recipes accordingly
- run the docker pull command in your terminal as instructed in Step 2 above
- Go to Deploy pillar → Clouds & Deployments
- Lookup the service you want to update
- Open the Service Operations menu
- Click Redeploy Service
Updating Other Images
- run the docker pull command in your terminal as instructed in Step 2 above
- Go to Deploy pillar → Clouds & Deployments
- Lookup the service you want to update
- Open the Service Operations menu
- Click Restart Service
Restart Service
This operation will restart your service using the exact same settings that were used to deploy it in the first place.
However, the SOAJS deployer inside the SOAJS image will perform a git clone operation that will clone the latest code updates from branch master.
Once the code is pulled, the deployer will run an NPM INSTALL command to install the dependencies needed and will start your service.
While the deployer is running, your old service remains operational until the new service is flagged as running by either Docker Swarm or Kubernetes depending on which of the two drivers you have chosen to deploy your SOAJS cloud with.
When the new service becomes ready, then the old one will be terminated; your SOAJS Service is now updated and is using the new image updates.
Redeploy Service
This operation will load the catalog recipe again, if the catalog recipe has changed then the service will be affected then it redeploys the service with the new recipe changes.
The SOAJS deployer inside the SOAJS image will perform a git clone operation that will clone the latest code updates from branch master.
Once the code is pulled, the deployer will run an NPM INSTALL command to install the dependencies needed and will start your service.
While the deployer is running, your old service remains operational until the new service is flagged as running by either Docker Swarm or Kubernetes depending on which of the two drivers you have chosen to deploy your SOAJS cloud with.
When the new service becomes ready, then the old one will be terminated; your SOAJS Service is now updated and is using the new image upgrades.