GithubHelp home page GithubHelp logo

deis / jenkins-jobs Goto Github PK

View Code? Open in Web Editor NEW
28.0 10.0 18.0 576 KB

DSL representations of Jenkins jobs for Deis

License: MIT License

Groovy 66.00% Makefile 0.62% Shell 33.38%
jenkins ci deis-workflow unsupported

jenkins-jobs's Introduction

Deis Workflow is no longer maintained.
Please read the announcement for more detail.
09/07/2017 Deis Workflow v2.18 final release before entering maintenance mode
03/01/2018 End of Workflow maintenance: critical patches no longer merged
Hephy is a fork of Workflow that is actively developed and accepts code contributions.

Deis Workflow Jenkins Jobs

Deis (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any Kubernetes cluster, making it easy to deploy and manage applications on your own servers.

For more information about the Deis Workflow, please visit the main project page at https://github.com/deis/workflow.

About

This repository serves as a central location for Deis Workflow Jenkins jobs represented in Jenkins Job DSL.

Resources

The definitive wiki resource describing all available Jenkins Job DSL API items can be found in the Jenkins Job DSL Plugin API. See also the following helpful overview of the Job DSL Plugin for those new to this project.

All jobs are written in Groovy which runs on the Java platform hosted on Jenkins.

Directory Structure

The DSL representation of a given job is currently placed in the jobs directory. As much as possible, the actual shell logic that gets executed during a job's runtime is placed in the bash/scripts directory. Correlating Bats tests for these scripts are located in bash/tests.

Working with Groovy

For debugging general Groovy code, one may run make groovy-console provided one has a Java JDK or JRE installed (version 7 or higher; see Gradle Prerequisites).

Alternatively, one may use the handy-dandy Groovy Web Console.

Testing

There are containerized and non-containerized targets for all test-related make tasks.

bash

For testing bash script changes/additions, one may run make (docker-)test-style to run the shellcheck static analysis tool against script syntax and make (docker-)test-scripts to run the suite of bats tests located in bash/tests. (Note: if running the non-containerized target(s), bats and shellcheck are prerequisites)

DSL/Groovy

For testing that the jobs' DSL/Groovy logic parses correctly, one may run make (docker-)test-dsl. (There is also a docker-test-dsl-quick target that starts the stopped gradle-test container if it exists, capitalizing on cached dependencies.) (Note: if running the non-containerized target(s), the Gradle Prerequisites are needed)

Regardless of target, test results may be viewed in a web browser after they finish via make open-test-results.

How it works: Each job is processed against the versions of Jenkins and the Job DSL Plugin as defined in gradle.properties, as well as the versions of necessary plugins required by the job(s), as declared in the dependencies block of build.gradle.

Therefore, if all jobs parse without failures, one can be reasonably confident they will build successfully on the live Jenkins instance, provided the aforementioned dependency versions are aligned.

This Gradle-based test harness was set up using a slimmed-down/modified version of the Jenkins Job DSL Gradle Example.

Upgrading Jenkins plugins

Since a test harness exists for checking that the job DSL compiles, one can also check that an upgraded/added plugin plays nicely with existing/new jobs.

To do so, one would update/add the appropriate plugin in build.gradle and then run make (docker-)test-dsl to make sure compilation is unaffected. This is meeant to provide a higher level confidence before actually upgrading/adding plugin(s) on the live Jenkins instance.

Flow

As a standard practice, the initial job will describe the pipeline, in the form of downstreamParameterized steps that follow the main steps of the job itself. See the Workflow component job as an example. Most of the downstream jobs are then set up to only execute their specific job logic, and not add further downstream dependencies that might be different from what the initial job specifies.

(The pipelines below can also be found in their original .monopic format if needing to change/update.)

Component PR/Master Pipeline

                                          Component Pipeline start
                                                (PR, master)

                                        ┌───────────────────────────┐                                         ┌─────────────────────────────────┐
                                        │                           │                                         │     Commit type: REPO_TYPE      │
                                        │                           │ - check out source code                 │                                 │██
                                        │    component Docker image │ - build and push Docker                 │        PR commit: 'pr',         │██
               ┌─────────────────────   │       build/deploy job    │          image          ─────┐          │     Merge to master: 'dev'      │██
               │                        │                           │ - on success, initiate       │          │ Official release: 'production'  │██
               │                        │                           │     downstream job           │          │                                 │██
               │                        │                           │                              │          │ Staging for release: 'staging'  │██
               ▼                        └───────────────────────────┘                              │          │         (only Workflow)         │██
                                                                                                   ▼          └─────────────────────────────────┘██
                                                                                                                ███████████████████████████████████
       if change to chart                                                                                       ███████████████████████████████████
    ('charts' subdirectory)                                                         if NO change in to chart


   ┌───────────────────────────┐                                                  ┌───────────────────────────┐
   │                           │                                                  │                           │   - set GitHub status to 'Pending'
   │                           │                                                  │                           │                (if PR)
   │     component chart       │  - package chart from specified                  │                           │  - run end-to-end tests against test
   │         publish           │              commit                              │     workflow chart e2e    │            image supplied
   │                           │ - publish to specified chart repo                │                           │   - report result to Slack (as well
   │                           │                                                  │                           │           as GitHub if PR)
   │                           │                                                  │                           │
   └───────────────────────────┘                                                  └───────────────────────────┘
               │                                                                                │
               │                                                                                │
               ▼                                                                                ▼
   ┌───────────────────────────┐                                                  ┌───────────────────────────┐
   │                           │                                                  │                           │
   │                           │      - package workflow chart                    │                           │          (if Master merge)
   │     workflow chart        │ (injecting specific component chart              │                           │ - pull image from dev repo/registry
   │         publish           │        version if supplied)                      │     component promote     │ - push/promote image to production
   │                           │  - publish to specified chart repo               │                           │            repo/registry
   │                           │                                                  │                           │
   │                           │                                                  │                           │
   └───────────────────────────┘                                                  └───────────────────────────┘
               │
               │
               ▼
   ┌───────────────────────────┐
   │                           │  - install workflow and workflow-e2e
   │                           │  charts via helper tools (e2e-runner,
   │                           │  k8s-claimer)
   │    workflow chart e2e     │  - (can set chart values for both
   │                           │  depending on env vars)
   │                           │  - report result to Slack (as well as
   │                           │  GitHub if PR)
   └───────────────────────────┘

Component Release Pipeline




   Component Release Pipeline
              start

  ┌───────────────────────────┐
  │                           │
  │                           │ - triggered by `v1.2.3` git tag
  │                           │             webhook
  │     component-release     │
  │                           │ - locate release candidate image
  │                           │     associated with git tag
  │                           │
  └───────────────────────────┘
               │
               │
               ▼
  ┌───────────────────────────┐
  │                           │
  │                           │
  │                           │  - retag candidate image with
  │ release candidate promote │   official release (v1.2.3)
  │                           │
  │                           │
  │                           │
  └───────────────────────────┘
               │
               │
               ▼
  ┌───────────────────────────┐
  │                           │
  │                           │
  │    component release      │  - publish release data to
  │         publish           │    workflow-manager-api
  │                           │
  │                           │
  │                           │
  └───────────────────────────┘
               │
               │
               ▼
  ┌───────────────────────────┐
  │                           │
  │                           │ - publish signed and packaged chart
  │     component chart       │           to 'production'
  │         publish           │
  │                           │   - publish packaged chart 'dev'
  │                           │             chart repos
  │                           │
  └───────────────────────────┘
               │
               │
               ▼
  ┌───────────────────────────┐
  │                           │
  │                           │
  │                           │    - verifies signature of chart in
  │  component chart verify   │        'production' chart repo
  │                           │
  │                           │
  │                           │
  └───────────────────────────┘

When Workflow-CLI is tagged

    Workflow CLI Release
          Pipeline

┌───────────────────────────┐
│                           │
│                           │
│                           │ - triggered by `v1.2.3` git tag
│    workflow-cli-release   │             webhook
│                           │
│                           │
│                           │
└───────────────────────────┘
            │
            │
            ▼
┌───────────────────────────┐
│                           │ - check out git tag of source
│                           │              code
│                           │ - build cross-compiled default
│  workflow-cli-build-tag   │  (linux, darwin and windows;
│                           │      amd64, 386) binaries
│                           │       - upload binaries
│                           │
└───────────────────────────┘
            │
            │
            ▼
┌───────────────────────────┐
│                           │
│                           │ - check out git tag of source
│   workflow-cli-build-     │             code
│           tag             │   - build amd64 binary with
│      darwin-amd64         │  CGO_ENABLED=1 on OSX slave
│                           │ - upload darwin amd64 binary
│                           │
└───────────────────────────┘

 Note: There are also "workflow-cli-build-stable(-darwin-amd64)"
 variants of the two downstream jobs above, but these are currently
 only triggered manually.

When a Workflow Helm Chart is to be released


   Workflow Chart Release
          Pipeline
                                - triggered manually with supplied release
┌───────────────────────────┐                      tag
│                           │
│                           │    - update chart dependencies by gathering
│                           │    latest releases for all component charts
│   workflow-chart-stage    │
│                           │  - upload signed and packaged candidate chart
│                           │     (sans index file) to 'production' repo
│                           │
└───────────────────────────┘    - upload packaged candidate chart (with
             │                     index file) to 'staging' charts repo
             │
             ▼
┌───────────────────────────┐
│                           │   - lease GKE cluster, install Workflow chart
│                           │     (version handed down from upstream) from
│                           │                  'staging' repo
│    workflow-chart-e2e     │
│                           │           - install workflow-e2e chart
│                           │
│                           │   - archive test results and report job status
└───────────────────────────┘            to appropriate channel(s)
             │
             │
             ▼
┌───────────────────────────┐
│                           │  - triggered manually with supplied release
│                           │                     tag
│                           │
│  workflow-chart-release   │   - pull down approved, signed chart from
│                           │           'production' chart repo
│                           │
│                           │ - update index file, upload to 'production'
└───────────────────────────┘      charts repo, making it officially
             │                           fetchable/installable
             │
             ▼
┌───────────────────────────┐
│                           │
│                           │ - verifies signature of chart from 'production'
│                           │                      repo
│    helm-chart-verify      │
│                           │      - (job succeeds if command succeeds)
│                           │
│                           │
└───────────────────────────┘

jenkins-jobs's People

Contributors

arschles avatar helgi avatar jchauncey avatar joshua-anderson avatar kmala avatar krancour avatar mboersma avatar sgoings avatar slack avatar vdice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jenkins-jobs's Issues

Add test-ec2 job

Testing for Deis v1 should be less urgent but will not go away for a long time, so the all-important "test-ec2" job and its friends should be made Groovy and checked in here.

Seed job

We should make the seed job the source of record for all jenkins configuration.

  • Should run every X minutes
  • Should destroy any job/configuration that is not in the DSL
  • Should replace workflow-test-seed-job and component-seed-job

component-pr job failed to push image to DockerHub, but job still succeeded

See https://ci.deis.io/job/controller-pr/911/console:

14:05:48 Successfully built 8fb640adf706
14:05:48 docker tag deisci/controller:git-d7d1c9d deisci/controller:canary
14:05:48 docker push deisci/controller:git-d7d1c9d
14:05:48 The push refers to a repository [docker.io/deisci/controller]
14:05:49 8c1fc4ab0488: Preparing
14:05:49 6b772acdb3a3: Preparing
14:05:49 056edaa0a2eb: Preparing
14:05:49 9eb130d61eec: Preparing
14:05:49 f7e7f3d0c903: Preparing
14:05:49 5f70bf18a086: Preparing
14:05:49 f34e865127cf: Preparing
14:05:49 5f70bf18a086: Waiting
14:05:49 f34e865127cf: Waiting
14:05:50 6b772acdb3a3: Layer already exists
14:05:50 6b772acdb3a3: Layer already exists
14:05:50 8c1fc4ab0488: Layer already exists
14:05:50 8c1fc4ab0488: Layer already exists
14:05:50 f7e7f3d0c903: Layer already exists
14:05:50 f7e7f3d0c903: Layer already exists
14:05:50 056edaa0a2eb: Layer already exists
14:05:50 056edaa0a2eb: Layer already exists
14:05:50 9eb130d61eec: Layer already exists
14:05:50 9eb130d61eec: Layer already exists
14:05:50 f34e865127cf: Layer already exists
14:05:50 f34e865127cf: Layer already exists
14:05:50 5f70bf18a086: Layer already exists
14:05:50 5f70bf18a086: Layer already exists
14:05:51 git-d7d1c9d: digest: sha256:d161ee40d57dd3ab8c95855ccc514ea9aa078f47caf8904b069c338eedf265c2 size: 1760
14:05:52 WARNING: login credentials saved in /home/jenkins/.docker/config.json
14:05:52 Login Succeeded
14:06:23 Unable to connect to the server: dial tcp 104.197.71.127:443: i/o timeout
14:06:23 docker build --rm -t quay.io/deisci/controller:git-d7d1c9d rootfs
14:06:24 Sending build context to Docker daemon   319 kB

And eventually:

4:06:30 Triggering projects: workflow-test-pr
14:06:30 Setting status of 86cb3e34a7b1fc11df7435b71c13b05c5640c3b7 to SUCCESS with url https://ci.deis.io/job/controller-pr/911/ and message: 'Merge with caution! Test job(s) may still be in progress...
14:06:30  '
14:06:30 Using context: ci/jenkins/pr
14:06:30 Finished: SUCCESS

Ultimately this job should've failed on the i/o timeout and gone red at that point, because the downstream job failed pulling the image: https://ci.deis.io/job/workflow-test-pr/3188/

Create workflow-cli(-pr) jobs

After #124 we are set up to build out workflow-cli(-pr) jobs. They won't necessarily follow most of the common logic in the existing component_jobs.groovy and the build/(unit) test/deploy logic is handled currently by travis/appveyor, so we just want jobs to get kicked off on commits to master/PR branches (respectively) and hand the commit sha, when applicable (for PRs) to the downstream e2e test job.

TODOs

  • remove the line here as the env var will be auto-generated and passed to the downstream test job when these new jobs are created.

Add pipeline description/visual aid

We need an overview of the CI pipeline with details on all the moving parts.

I'm thinking text description added to the README and in addition a visual aid (perhaps an html representation somewhere in Jenkins -- represented using the job DSL plugin)

Extract common Pipeline logic into DSL extensions

Part of Meta ticket #117
Estimated size: [L]

Extract common logic used in Workflow component pipelines created in #118 and #119 into the Global DSL library

Once logic is in Global DSL Library, iterate through each component repo and issue refactor PRs updating with use of common DSL (may amend this description with TBD PRs as they are created)

Build pipeline for deis.com + documentation

As we consolidate documentation into deis.com, we need to have a build pipeline for all of our docs/websites.

Upstream websites or docs projects (current):

  • deis/workflow
  • engineyard/deis.com

Any green build of master from should trigger a downstream deis/gutenberg job to deploy to staging. Successful deploy of staging should deploy to production.

Will have staging and prod IAM credentials for s3 upload and cloudfront distribution invalidation.

workflow-test job kicked off by CI auto commit

The workflow-test job has logic (seen here) which will auto-increment a vetted component image tag in the charts repo. This same auto-increment commit, however, invokes another (redundant) build of workflow-test since this job is looking for git pushes in said charts repo.

It would be nice to detect this and not use resources to run redundant tests.

How to test 'paired' changes in separate repos

Our CI pipeline currently only supports running e2e against one specific commit in one repo. However, our e2e jenkins job in isolation actually does have the capacity to track and test multiple commits (see all <COMPONENT>_SHA env vars here).

One angle might be to make use of the ghprbLongDescription value that we get in using the GitHub Pull Request Builder Plugin. As long as the committer supplied a standard message in the commit body, something along the lines of:

Requires slugrunner sha 80281d0
Requires builder sha 45ac6da
...

and so on, for the one or more required/'paired' changes, then our test job could feasibly be provided said sha's in the form of appropriate env vars from above.

[Meta] Revise CI pipeline into smaller units

This ticket tracks the work needed to revise the current CI pipeline for a given Deis component change into the following state:

proposed_pipeline

  • Create unit test job DSL: #21
  • Create integration test job DSL: #22
  • Create claim cluster job DSL: #23
  • Modify current e2e test job DSL (workflow_test.groovy) to only run tests, afterwards kicking off the following two jobs concurrently: #26
  • Create cluster cleanup job DSL: #24
  • Create chart bumpver job DSL: #25

TODO

  • Create actual visual/graphic of pipeline for each component

Have each job in CI pipeline update Github with status

Right now we only have 2 jobs in the component 'release' pipeline:

<component>(-pr) job which builds and deploys its immutable artifact (Docker image tag) and workflow-test(-pr) which runs the tests against that artifact, officially promoting it to chart if success.

We have relied on having the first job block on the downstream test job, for updating the GitHub PR status. This already presents bottleneck issues and will only be exacerbated as more jobs are added to the pipeline (see #20 for more info on this endeavor).

Therefore, we would rather remove this blocking behavior and instead have each job in the pipeline be able to run a script to update the GitHub PR status with its build result. See https://developer.github.com/v3/repos/statuses/ for info on how this can be done.

add workflow stress test

cross-post of deis/deis#4037

@jchauncey has found some interesting problems when running significant load through deis. I'd like to see an automated version of this test (or similar) so that we can watch deis' performance over the course of future releases. We could even run this on the various providers and compare performance. 😄

Milestone watcher job

This proposes a solution to eliminating the manual Step #2 from the release-checklist.md. It currently involves cloning this repo, updating a value and pushing commit to master.

Instead, we can create a chron (daily?) job that can make the appropriate GH api call and determine the next immediate 'open' milestone. Once this value is acquired, the job would determine if it is different from the current value. If so, it would update via a commit to master. If no, finish the build with a no-op.

Document Pipeline use

Part of Meta ticket #117
Estimated size: [S]

Document Pipeline/Jenkinsfile approach and how to use in existing/new repos, including linking to examples created in #119 and available DSL extensions created in #120

[Meta] Transition to Jenkins Pipeline

This meta tracks the tickets needed to replace existing job definitions with in-repo Jenkins Pipeline representations:

  • Transition first Workflow component repo to Jenkins Pipeline: #118
  • Transition remaining Workflow component repos to using Jenkins Pipeline: #119
  • Extract common logic used in Workflow component pipelines into the Global DSL library: #120
  • Document new Pipeline/Jenkinsfile approach and how to use in existing/new repos: #121
  • Replace remaining (non-component) jobs in jenkins-jobs with Pipeline: #122

Bonus/if still warranted: Wrap up global DSL into 'official' Pipeline plugin(s)

Modify workflow_test

Modify the workflow_test such that it is only responsible for running the e2e tests. When finished, it will kick off the applicable downstream job(s) (#24 regardless of job result and #25 if success)

[Meta] Transfer component build/deploy steps from Travis to Jenkins

As we move our CI infrastructure to Jenkins, less functionality will be needed in Travis. Eventually, we are planning to cease the dependence on Travis entirely, but this ticket tracks the reduced scope of moving build and deploy steps for master commits to Jenkins.

Add build/deploy steps to Jenkins component_job(s):

Remove Travis build/deploy steps from components:

component-seed-job failing

The component-seed-repo job is now failing as of e30a74f. See https://ci.deis.io/job/component-seed-job/56/console

09:45:17 Processing DSL script monitor_jobs.groovy
09:45:17 ERROR: (monitor_jobs.groovy, line 43) No such property: isPr for class: javaposse.jobdsl.dsl.helpers.scm.GitContext
09:45:17 [BFA] Scanning build for known causes...
09:45:17 [BFA] No failure causes found
09:45:17 [BFA] Done. 0s
09:45:17 Finished: FAILURE

extract bash logic and cover under test

With #104, the bats was brought in to test bash logic included in jobs. Only the logic introduced as part of the PR was covered under test, therefore, this ticket represents the refactor work necessary to cover the rest of the bash logic under test.

create seed-repo job

This job will apply seed-repo to any component under our control. This will help with applying any changes made to seed-repo immediately without any user intervention.

Usage should be:

  • make a PR on seed-repo
  • PR gets reviewed and approved
  • PR gets merged, kicking off a seed-repo job
  • all existing components under the seed-repo umbrella are updated

related to work at #55 for automating release tasks.

DSL-ize (or delete) manually created jobs

Before we can execute #29 we have to move the following jobs to the jenkins job dsl in this repo:

  • build-deis-cli-installer-darwin
  • build-deis-cli-installer-linux
  • build-deisctl-cli-installer-darwin
  • build-deisctl-cli-installer-linux
  • rigger-provision-all
  • rigger-provision-azure
  • test-acceptance
  • test-ec2

Delete (might require a jenkins restart):

  • workflow-e2e-pr-clone
  • workflow-e2e-pr-parallel
  • workflow-test-parallel (test jobs now run parallel by default)
  • test-coreos-alpha
  • test-coreos-beta
  • test-coreos-stable

add ability to specify PR number for commit dependencies

#104 adds the ability to require other commits for the inclusion in the build/test pipeline.

It would be preferable if instead of having to supply the commit sha in Requires <repo_name>#<commit_sha> one could just reference the PR number: Requires <repo_name>#<PR_number> as is the usual protocol when referencing another issue/PR in GitHub.

The api call would probably be this one and see here for an example of curl-ing the commit status GH API.

Enable release testing via PRs

Right now our release process is such that someone creates a PR that adds a chart with some semver notation, such as: workflow-beta2 and commits using our standard commit message style: chore(release): ... and then we generate a special Jenkins job just to test that one PR.

It would be neat if the Jenkins job that tests PRs is aware of this special key (chore(release):...) in a git commit message then figured out two things:

  • the chart to test (that's being committed in this pr... like workflow-beta2)
  • the chart that's used to test the chart above (that's also being committed as a part of the release)

It would combine the findings above and "run the right tests" and vet our release for us.

create component release job

We have the need for a component-release-job that would track git push events to a release* branch on any/all of our Workflow component repos.

Use case: If someone creates a release branch, we want a Docker image created and pushed from that release branch.

Further, if they modify that branch (i.e. from fixes, cherry-picking or rebase), this job should fire again and push a new image, ready for use in a release chart.

Implementation details:

As of this writing, we are leaning to one .groovy file set up to track all component repos, rather than adding separate -release jobs for each component via additional configuration in the existing component_jobs.groovy file.

Transition first Workflow component to Jenkins Pipeline

Part of Meta ticket #117
Estimated size: [M]

Take one Workflow component repo and convert to using Jenkins Pipeline/Jenkinsfile

  • Replicating component pipeline as exists now: image build/push job -> e2e job
  • See component_jobs.groovy and
    workflow_test.groovy
  • Should include getting rid of Travis and replacing w/ a correlating stage in Jenkinsfile
  • Questions needing answers:
    • How are forked PRs (read: most PRs) handled? Based on current reading, it doesn't appear that only branches on origin are tested.
    • How are slack notifications handled? Can we finally fine-tune Slack channels depending on repo?

Create unit test job DSL

This job should run the unit tests for a given component (see list of currently tracked components here).

Reference the meta issue for upstream/downstream configuration.

Update README

It was copy-pasted from deis/controller, which will eventually confuse someone.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.