Skip to main content
Version: 4.0.x

Migrate from Legacy Jobs

CloudOps for Kubernetes now provides V2 Pipelines as the recommended path for new Self-Managed Commerce build, test, and deployment automation.

All legacy jobs remain available during the transition, but teams should plan to adopt the V2 jobs for future work.

Why Move to V2 Pipelines

The V2 model improves on the older Jenkins workflows in several important ways. For details, see V2 Pipelines Overview

Approach Overview​

The overall approach to adopting the new V2 pipelines is:

  • Convert your container image build to use the v2-build-commerce-images build job.

    1. First, ensure that your ep-commerce branch contains the Build Tools code. See Update your ep-commerce Code.

    2. Then update your code build workflow to call the new V2 v2-build-commerce-images job instead of the older jobs.

      When this is complete, you no longer need to use, manage, or update the Elastic Path docker project. The V2 build jobs use container configuration files exclusively from the ep-commerce project. Remember to keep up to date with the ep-commerce patches.

  • Update your code deployment workflow to call the new v2-deploy-commerce-images job instead of the older jobs.

    When both of the above are complete, your build and deploy pipeline becomes simpler: run v2-build-commerce-images to build new code and then run v2-deploy-commerce-images to apply the images to a Commerce environment.

  • Migrate your environment configuration to the new file-based configuration.

    1. Begin with a lower environment (for example, a development environment).

    2. Roll out to higher environments (for example, staging).

    3. Roll out to production.

    4. Going forward, run the V2 v2-configure-commerce-environment job when you want to apply either Terraform updates or your configuration file updates.

      When this is complete, all of your Commerce environment configuration is tracked in and driven by files in Git. You can use Git's approval workflow to review changes before they are applied, and the change history to track when changes were made, and why.

The sections below provide more detail on each of these.

You can do these in any order

The V2 build job, V2 deployment job, and V2 configuration job are independent of each other. Teams can adopt them in whichever order makes sense for them.

Update your ep-commerce Code​

Your application development team should ensure that your Self-Managed Commerce ep-commerce branch includes the Self-Managed Commerce Build Tools code. Then your DevOps and development teams should confirm that any Elastic Path docker customizations are migrated to the ep-commerce Build Tools files.

note

Self-Managed Commerce releases 8.2.x and earlier are not compatible with Build Tools and the new CloudOps for Kubernetes V2 pipelines.

Consume Build Tools patches​

As a guide, check that your ep-commerce branch includes the paths listed below.

  • devops/build_tools_extras/configure_build_host.sh
  • devops/build_tools/build_source_tree.sh
  • devops/build_tools/build_container_layout.sh
  • devops/build_tools/build_base_images.yml
  • devops/build_tools/build_commerce_images.yml

The initial release of Self-Managed Commerce 8.8.x included the required files. The initial release of Self-Managed Commerce 8.7.x included some of the files, but patches are required for others. These files were not included in the initial release of Self-Managed Commerce 8.6.x or earlier, and are provided as patches. In all releases, new patches provide improvements and address security concerns.

Apply the Self-Managed Commerce patches to ensure that you have the required Build Tools code and updates. See Consuming Support Fixes for instructions on obtaining and applying Self-Managed Commerce patches.

Migrate Elastic Path docker Customizations to ep-commerce​

If your team has implemented any customizations in the Elastic Path docker project, identify those and migrate them to the Build Tools files. The paths to some of the commonly customized files are shared below.

  • Commerce application Dockerfiles are found under extensions/packager/ext-container-layout/src/main/files/*.Dockerfile
  • The Tomcat base image Dockerfile is found at devops/build_tools/roles/tomcat/templates/Dockerfile.j2
  • The Tomcat configuration files are found at devops/build_tools/roles/tomcat/files
  • The Java base image Dockerfile is found at devops/build_tools/roles/amazonlinux_java/templates/Dockerfile.j2
  • The ActiveMQ image Dockerfile is found at devops/build_tools/roles/activemq/templates/Dockerfile.j2

Switching Build Jobs​

The various "legacy" build jobs listed in the table below are replaced with two new V2 builds jobs.

Legacy job V2 replacement job Notes
build-deployment-package v2-build-commerce-maven-artifacts In the legacy jobs, the build-deployment-package job compiled all of the application binaries. This is now performed by the v2-build-commerce-maven-artifacts job.
build-core-images v2-build-commerce-images All base and application images, plus ep/info-page, are now built by the v2-build-commerce-images job.
build-commerce-images
build-selected-images
build-activemq
build-base-image
build-batch
build-cm
build-cortex
build-data-pop
build-data-sync
build-integration
build-mock
build-mysql
build-search
build-infopage
note

The new v2-build-commerce-maven-artifacts and v2-build-commerce-images use images with specific image tags to identify and pass the correct Maven artifacts and build output. The default image tag is the ep-commerce project's short commit hash.

One job to build everything

You can run just the v2-build-commerce-images job. If the required commerce-maven-artifacts image already exists in ECR, then the job will use it. Otherwise the v2-build-commerce-images job will call the v2-build-commerce-maven-artifacts job to build it.

For more information, see V2 Builds and Artifacts.

Switching Deploy Jobs​

The legacy deploy jobs listed in the table below are replaced by the v2-deploy-commerce-images job.

Legacy job V2 replacement job Notes
Using pull-docker-images to re-tag images within the same account. v2-deploy-commerce-images The v2-deploy-commerce-images job can re-tag images (optional), update the specified Commerce environment to use the specified image tag, and run data-pop (optional).
run-data-pop-tool
restart-commerce-stack
note

Continue to use pull-docker-images when you need to pull images across AWS accounts, such as from non-production into production.

Switching Configuration Jobs​

The legacy configuration jobs listed in the table below are replaced by the v2-configure-commerce-environment job.

Legacy job V2 replacement job Notes
deploy-or-delete-commerce-stack v2-configure-commerce-environment The database server, ActiveMQ and Commerce stack can now all be created, updated or re-configured using YAML files and the v2-configure-commerce-environment job.
create-and-manage-database-server
create-or-delete-mysql-container
create-or-delete-activemq-container
use-existing-database-server

For more information, see Configuring Environments with V2 Pipelines and Environment Files Reference.

Deleting an Environment

Use the v2-destroy-commerce-environment job when you want to delete a Commerce environment.

New Operations Jobs​

v2-deploy-commerce-images​

Use the new job v2-deploy-commerce-images to deploy new Commerce images to an existing Commerce environment. This job can optionally re-tag the images before deploying, or optionally run data-population update-db if data-pop is required.

This job does not apply Terraform configuration changes, making it better for code deployments than the new v2-configure-commerce-environment job and the deploy-or-delete-commerce-stack job.

tip

You can start using the v2-deploy-commerce-images job for Commerce deployments without needing to change how you configure your environments or how you build your Commerce images. You do not need to adopt other V2 jobs to use this job for deployments.

v2-set-commerce-service-replicas​

Use this job to scale one of the following Commerce services to a specific number of replicas:

  • cortex
  • search-slave
  • integration

v2-stop-start-commerce-environment​

Use this job to scale down all of the Kubernetes services in a Commerce environment's namespace, to effectively turn off the environment.

Switching Test Jobs​

The various "legacy" test jobs listed in the table below are replaced with two new V2 test jobs.

Legacy job V2 replacement job Notes
run-cortex-system-tests v2-run-cortex-system-tests The V2 job behaves the same but now calls the devops/build_tools/run-cortex-system-tests.sh Build Tools script, from the ep-commerce project.
commerce-branch-validation v2-commerce-branch-validation The V2 job leverages the new V2 build and deployment jobs, and uses the component templates in environments/branch-validation-template/.
tip

You can update or modify the templates in environments/branch-validation-template/ if you need to tune the configuration of the ephemeral test environments used in the v2-commerce-branch-validation job.

Migrating a Running V1 Environment to V2​

The job and table mappings above describe which V2 jobs replace which legacy jobs. If you have a long-lived environment that was originally created and is currently managed by V1 jobs, you also need V2 environment files before you can use v2-configure-commerce-environment to manage it.

Before you generate the files, choose a database approach and update the environment from the target branch by running the legacy ActiveMQ and Commerce stack jobs. If you want V2 to manage the database server configuration, also run the legacy job for your database implementation. Let each job finish applying. Otherwise, Terraform module changes that were never applied appear as planned changes during validation. For the job list and database options, see Before You Run the Job.

Then use the v2-generate-env-files-for-existing-environment job to generate those files automatically.

The job inspects the running environment and produces ready-to-review component YAML artifacts under generated-env-<kubernetesNickname>/. After you review and commit them under environments/<kubernetesNickname>/, you can replace the V1 legacy deploy jobs with v2-configure-commerce-environment for all future updates to that environment.

For full details on the job parameters, the databaseAdoptionApproach options, and the post-run steps, see Generate Environment Files for an Existing Environment.