[FOLIO-2671] provide a workflow for building and deploying FOLIO platform-core/complete stack into dev env Created: 01/Jul/20  Updated: 10/Aug/20  Resolved: 10/Aug/20

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: John Malconian Assignee: Stanislav Miroshnichenko
Resolution: Done Votes: 0
Labels: dev-environment
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Cloners
is cloned by FOLIO-2702 provide an option to deploy previous ... Closed
Sprint: DevOps: sprint 94
Development Team: FOLIO DevOps

 Description   

Note: Below is a description of the automatic workflows. Stanislav Miroshnichenko and Sergiy Vysotskiy will propose a manual workflow for building and deploying a custom bundle into the dev environment. This may work as a temporary workaround while the automatic workflow is being implemented.

Stanislav Miroshnichenko https://github.com/folio-org/folio-org.github.io/blob/folio-rancher-onboarding/_faqs/how-to-get-started-with-rancher.md
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Deployment of baseline based on platform-core

1. a set of modules that comprise the "core" is tracked in a Teraform file (initially based on the contents of install.json from platform-core), this is similar to how folio-testing works
2. the baseline can be refreshed by running a bash script through Teraform or manually by upgrading modules through the Rancher UI
3. tracks master branches (snapshots)

Deployment of the bundle based on platform-core

The pipeline in Rancher is too unstable and we need to build images in Jenkins and push them to Docker repository (docker.dev.folio.org) and make an API call to Rancher to deploy it.
Workflow for bundle deployment and bootstrapping backend modules:

1. developer goes to the platform-core/platform-complete repo and creates a branch
2. then on the branch edits package.json to include the select feature branch of a UI module
3. in Jenkins a generic job for platform-core/complete is set up where developers can specify build parameters which include: the platform- branch, team env name (namespace), Okapi URL, Tenant Id, (if the Okapi API is authenticated, we also need user creds)
4. trigger the build which created a Docker image
5. Docker image gets pushed to Nexus local repo
6. Post all UI module descriptors to the local env Okapi
7. Deployment in Rancher: Stanislav Miroshnichenko proposes to call Rancher API from the Jenkins pipeline to trigger deployment (which will use Helm under the hood) – this requires tenantId, okapi URL and namespace along with Helm parameters to be specified for the Jenkins pipeline

Deployment of individual backend modules

In order to deploy platform-complete we would need to individually deploy backend modules that are needed.
Workflow for build and deployment of individual backend modules:

1. the developer triggers the backend branch build through the Rancher pipeline (in there you can specify the branch)
2. this builds a Docker image (not uploaded to Nexus)
3. generate a Module Descriptor (for the branch build) and register with local Okapi
4. deployment is done from within the pipeline (deployment.yaml)

Since Helm, instead of Ansible, has been implemented as the method of deploying backend modules to dev environments, there needs to be an adequate process that allows developers to deploy a FOLIO stack with the all latest versions of backend modules from master.

Note about the approach Terraform and Helm approach:

1. i



 Comments   
Comment by Stanislav Miroshnichenko [ 06/Jul/20 ]

Using a 'terrafom taint' helps to redeploy backend modules.

Please use this shell script

Comment by Jakub Skoczen [ 08/Jul/20 ]

Stanislav Miroshnichenko: the pipeline in Rancher is too unstable and we need to build images in Jenkins and push them to Docker repository (docker.dev.folio.org) and make an API call to Rancher to deploy it.
Workflow for bundle deployment and bootstrapping backend modules:

1. developer goes to the platform-core/platform-complete repo and creates a branch
2. then on the branch edits package.json to include the select feature branch of a UI module
3. in Jenkins a generic job for platform-core/complete is set up where developers can specify build parameters which include: the platform- branch, team env name (namespace), Okapi URL, Tenant Id, (if the Okapi API is authenticated, we also need user creds)
4. trigger the build which created a Docker image
5. Docker image gets pushed to Nexus local repo
6. Post all UI module descriptors to the local env Okapi
7. Deployment in Rancher: Stanislav Miroshnichenko proposes to call Rancher API from the Jenkins pipeline to trigger deployment (which will use Helm under the hood) – this requires tenantId, okapi URL and namespace along with Helm parameters to be specified for the Jenkins pipeline

Workflow for build and deployment of individual backend modules:

1. the developer triggers the backend branch build through the Rancher pipeline (in there you can specify the branch)
2. this builds a Docker image (not uploaded to Nexus)
3. generate a Module Descriptor (for the branch build) and register with local Okapi
4. deployment is done from within the pipeline (deployment.yaml)

Manual steps for developers;

1. enable the module for selected tenant (e.g using curl with Okapi API) or create a new tenant

Note: Stanislav Miroshnichenko needs to research what it means add authentication for Okapi APIs.
jroot will file a ticket against Rancher to ask about the resource limitations

Comment by Jakub Skoczen [ 17/Jul/20 ]

Stanislav Miroshnichenko is working on supporting teams with their individual environments so this is on hold for now.

Comment by Jakub Skoczen [ 17/Jul/20 ]

John Malconian Stanislav Miroshnichenko Guys, on Monday (20 July) please review and update the workflows captured in the description section to make sure they match exactly the steps that Stanislav will be implementing. Thanks.

Comment by Stanislav Miroshnichenko [ 22/Jul/20 ]

Fixed issues and built UI Stripes bundle in Rancher pipeline.
1. In file 'package.json' increased memory limit to 8Gb '--max-old-space-size=8192'
2. Namespace memory limit for pipeline increased to 12Gb
3. To '.rancher-pipeline.yml' added parameters to build stage:
'''
cpuLimit: 1500m
memoryLimit: 8Gi
cpuRequest: 100m
memoryRequest: 100Mi
'''

Generated at Thu Feb 08 23:22:23 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.