The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.

Chapter 7 Managing Development, Test, Acceptance, and Production Life Cycles

Many Oracle Linux environments implement an application and system software life cycle known as DTAP, which stands for Development, Test, Acceptance, and Production. Spacewalk supports software channel cloning to simplify the process of promoting software configurations from development to test, test to acceptance, and acceptance to production.

Cloning an existing channel creates a new channel that reflects the state of the original channel's packages and errata at a particular point in time. You can modify a channel before cloning it, perhaps applying the errata available at a certain date or a set of errata that you have specifically selected. The cloned channel then provides a stable base for development and testing before release to production.

Spacewalk keeps track of all registered client systems and the software channels to which they are subscribed. Updates are available to client systems whenever their subscribed channels are updated. Alternatively, you can subscribe clients to a different channel, such as a cloned channel that contains new errata that have been tested. Cloning gives you more precise control over software configurations and establishes a methodical workflow to reduce the risk of production problems in mission-critical application environments.

You can use either the Spacewalk web interface or spacecmd to clone channels. You can specify whether to clone a channel in its current state including all errata, in its original state with only a selected set of errata, or in its original state with no errata.

The following example shows how you could use the softwarechannel_clone subcommand of spacecmd to clone a channel:

spacecmd {SSM:0}> softwarechannel_clone -s ol7u2-x86_64 -x "s/$/-clone/" -o

To clone a base channel and all of its children:

spacecmd {SSM:0}> softwarechannel_clonetree -s ol7u2-x86_64 -p "clone-"

Cloning is usually very fast as Spacewalk only needs to duplicate metadata entries in its database. It does not duplicate the packages themselves. Keeping channels small in size also helps to speed up channel cloning.

Cloning the base and patch channels for an Oracle Linux release is significantly faster than cloning the latest channel of an Oracle LInux release because the latest channel contains every version of every package from the initial release date to the current date. A base channel for an Oracle Linux release contains only what was shipped on the release's ISO image and a patch channel contains the updates made available since the ISO image was created. For this reason, base and patch channels are preferred sources for channel cloning.

When establishing a DTAP workflow, you might want to clone channels based on a particular date. You can use the spacewalk-clone-by-date utility to ensure that the new channel contains packages and errata up to and including a specified date.

For example, the following command clones a patch channel up to and including November 12, 2015:

# spacewalk-clone-by-date --username=swadmin --password=password \
  --channels=ol7u1-x86_64-patch ol7u1-x86_64-patch-151112 --to_date=2015-11-12

It is also possible to blacklist or remove certain packages, and to choose types of errata to include or exclude.

You can also make spacewalk-clone-by-date perform channel cloning based on a configuration file. You can create a configuration file by using the --sample_config option and then edit the file according to your requirements.

For example, the following configuration file clone-151112.conf clones the addons and patch channels up to and including November 12, 2015. The removelist section additionally specifies that any packages involving sendmail should not be included in the cloned channels.

{
  "username":"admin ",
  "passwd": "spacepw",
  "assumeyes":true,
  "skip_depsolve":false,
  "security_only":false,
  "blacklist": {
  },
  "removelist": {
    "ALL":["sendmail"]
  },
"channels":[
  {
    "ol7u1-x86_64-addons":"ol7u1-x86_64-addons-151112",
    "ol7u1-x86_64-patch":"ol7u1-x86_64-patch-151112",
  }
 ]
}

The command spacewalk-clone-by-date -d 2015-11-12 -c clone-151112.conf would create the cloned channels based on this configuration file.

In a DTAP environment, you might want to clone Oracle Linux channels on a periodic schedule, such as monthly or weekly. A typical DTAP workflow involves the Spacewalk server pulling packages and the latest errata from the ULN repository for development channels. Assuming integration testing requires less than five days in this scenario, you could configure Spacewalk to create test channel clones of the updated development channels automatically each week. After the test channels have passed all quality assurance tests and been accepted, you could then manually clone them into production channels.

While it is possible to use spacewalk-clone-by-date to set up a DTAP workflow, you might find it more convenient to use the spacewalk-manage-channel-lifecycle command to manage the life cycle of a software channel from development, through testing to production, as shown in the following examples:

  • Create a development channel dev-ol7-x86_64-appsvr based on the latest available packages in ol7-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c ol7-x86_64-appsvr --init
  • Promote the packages from the development channel to the test channel test-ol7-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c dev-ol7-x86_64-appsvr --promote
  • Promote the packages from the test channel to the production channel prod-ol7-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c test-ol7-x86_64-appsvr --promote

You can save the state of a channel by creating an archive channel archive-date-channel.

# spacewalk-manage-channel-lifecycle -c test-ol7-x86_64-appsvr --archive

If you need to restore the state of a channel, use the --rollback option and specify the archived version of the channel that you want to restore, for example:

# spacewalk-manage-channel-lifecycle -c archive-20110520-test-ol7-x86_64-appsvr --rollback

Use the -l option to list the channels:

# spacewalk-manage-channel-lifecycle -l
Channel tree:

 1. archive-20160203-ol7-x86_64-appsvr
      \__ archive-20160203-prod-ol7-x86_64-appcmd
      \__ archive-20160203-prod-ol7-x86_64-applib

 2. dev-ol7-x86_64-appsvr
      \__ dev-ol7-x86_64-appcmd
      \__ dev-ol7-x86_64-applib
  
 3. ol7-x86_64-appsvr
      \__ ol7-x86_64-appcmd
      \__ ol6-x86_64-applib

 4. prod-ol7-x86_64-appsvr
      \__ prod-ol7-x86_64-appcmd
      \__ prod-ol7-x86_64-applib

 5. test-ol7-x86_64-appsvr
      \__ test-ol7-x86_64-appcmd
      \__ test-ol7-x86_64-applib

After promoting a test channel to a production channel, you can put the accepted software configuration into production by subscribing your production systems to that channel on the Software Channel Subscriptions page of the web interface or by using the spacecmd system_setbasechannel, for example:

spacecmd {SSM:0}> system_setbasechannel svr5.mydom.com prod-ol7-x86_64-appsvr

To change the base channel for multiple production systems, you can map an existing base channel to a new base channel, for example:

spacecmd {SSM:0}> system_setbasechannel channel:ol7-x86_64-QAr1-base \
  ol7-x86_64-QAr2-base