Update Guide to version 4.x for OpenDevStack users
Learn all about how to update your OpenDevStack based project to ODS 4.x.
It is assumed that you are updating from ODS 3.x. |
Update image tags of Jenkins deployments
Go into your OpenShift *-cd
namespace and edit (via "Actions" > "Edit") the
deployments (jenkins
and webhook-proxy
) to point to the new image tags
(4.x
), and trigger a deployment.
Jenkins Shared Library
What’s new?
Deployment
resources
ODS has had support for the OpenShift-specific DeploymentConfig
resources (controlled by ReplicationControllers) only so far. Now, Kubernetes-native Deployment
resources (controlled by ReplicaSets) can be used as well in the component pipeline. Deployment
resources are recommended by OpenShift going forward, see https://docs.openshift.com/container-platform/latest/applications/deployments/what-deployments-are.html.
Helm
Helm 3 is supported now in the component pipeline. This means that Helm (with plugins helm-diff and helm-secrets) can be used as an alternative to Tailor (OpenShift Templates) to define Kubernetes resources in your repository. Helm has some limitations in OpenShift 3.11, but it is the recommended way forward on OpenShift 4. Tailor will be phased out at some point in the future when OpenShift 3.11 is no longer supported by ODS. If you do not author Kubernetes resources in your repository, now is a great time to start with Helm. If you already define OpenShift Templates in your repository and want to switch to Helm, read the migration guide from Tailor to Helm.
branch
/branches
options for all stages
-
All ODS component stages understand the
branch
/branches
options now. Those options allow pipeline authors to control for which branches a specific stage should run. As with thebranchToEnvironmentMapping
option, three types of branch references are supported:-
exact match (e.g.
master
,develop
- matching branches namedmaster
,develop
) -
prefix match (e.g.
release/
, 'feature/' - matching branches namedrelease/1
,feature/foobar
) -
wildcard match (
*
- matching all branches)
-
Required changes to adopt 4.x
-
Update
@Library('ods-jenkins-shared-library@3.x') _
to@Library('ods-jenkins-shared-library@4.x') _
and point to agent images with the4.x
tag, e.g. changeimageStreamTag: 'ods/jenkins-agent-golang:3.x'
toimageStreamTag: 'ods/jenkins-agent-golang:4.x'
. -
Application images are built in your
-cd
project now. Previously they were built in your-dev
and*-test
project. While the update itself should be completely automatic, there are two consequences:-
You can delete
BuildConfig
andImageStream
resources from your OpenShift templates (in factodsComponentStageBuildOpenShiftImage
does not runtailor apply
anymore). -
If you made modifications to a
BuildConfig
you’ll need to re-apply those changes in your*-cd
project once theBuildConfig
has been migrated there by a pipeline run. -
ODS 3.x introduced
odsComponentStageImportOpenShiftImageOrElse
, which allowed to execute some stages only if a container image could not be imported from another namespace or already existed in the current namespace. In ODS 4.x, the check for existing images is only performed in the*-cd
namespace. To reflect this,odsComponentStageImportOpenShiftImageOrElse
has been deprecated, and is now aliased to the new method,odsComponentFindOpenShiftImageOrElse
. The pipeline optionimagePromotionSequences
has been removed as it is not applicable anymore.
-
-
odsComponentStageRolloutOpenShiftDeployment
rolls out all deployment resources together now. If you had multipleDeploymentConfig
resources previously, you had to target each one by specifying the config optionresourceName
. This is no longer possible - instead the stage iterates over allDeploymentConfig
resources with the component label (app=${projectId}-${componentId}
). Changes must be made to pipelines that have multiple deployments, such as components based on theds-jupyter-notebook
andds-rshiny
quickstarter. -
The auto-cloning feature has been removed. If you used this to create ad-hoc namespaces per Jira issue, this is no longer possible now. Changes must be made if your pipeline configured
autoCloneEnvironmentsFromSourceMapping
. Please see https://github.com/opendevstack/ods-jenkins-shared-library/issues/374 for more information. -
Versioned development environments in orchestration pipeline are not created automatically anymore. Note that it is still possible to use separate development environments per version, but the namespaces have to be created manually upfront. Take this into account if your pipeline configures
versionedDevEnvs: true
. Please see https://github.com/opendevstack/ods-jenkins-shared-library/pull/513 for more information. -
odsComponentStageRolloutOpenShiftDeployment
changed its return type because it now supportsDeployment
resources, as well as multiple deployment resources. Therefore, it returns a map now, where the keys are<kind>/<name>
, e.g.Deployment/foo
andDeploymentConfig/bar
. This only affects pipelines that make use of this return value, such as components based on theds-ml-service
andbe-fe-mono-repo-plain
quickstarter.
ds-ml-service quickstarter no longer supported
If you provisioned ds-ml-service
quickstarter, please note that it has been moved out from the officially supported quickstarters (ods-quickstarters
) repository and moved to extra-quickstarters
. It has been set as deprecated due to being superseded by other OpenSource projects like MLflow and Cloud SaaS solutions.