From 83d66640eeb336754605bfdced06f0d28dbf5df1 Mon Sep 17 00:00:00 2001 From: Victor Laza Date: Thu, 16 Apr 2015 15:32:11 +0300 Subject: Added opnfv-jjb-usage.rst , opnfv-artifact-repository.rst & some dummy structure JIRA: OCTO-40 - Added opnfv-jjb-usage.rst , opnfv-artifact-repository.rst & also some dummy structure so we don't fail the builds; improvements are on the way Change-Id: I9eacaea54cf0d289fb1a8001f8a913cd506b66bf Signed-off-by: Victor Laza --- design_docs/main.rst | 1 + docs/opnfv-artifact-repository.rst | 80 ++++++++++++++++++ docs/opnfv-jjb-usage.rst | 164 +++++++++++++++++++++++++++++++++++++ docs/release/main.rst | 1 + requirements/main.rst | 1 + 5 files changed, 247 insertions(+) create mode 100644 design_docs/main.rst create mode 100644 docs/opnfv-artifact-repository.rst create mode 100644 docs/opnfv-jjb-usage.rst create mode 100644 docs/release/main.rst create mode 100644 requirements/main.rst diff --git a/design_docs/main.rst b/design_docs/main.rst new file mode 100644 index 0000000..7bfa94b --- /dev/null +++ b/design_docs/main.rst @@ -0,0 +1 @@ +Just a dummy file diff --git a/docs/opnfv-artifact-repository.rst b/docs/opnfv-artifact-repository.rst new file mode 100644 index 0000000..a0f4be1 --- /dev/null +++ b/docs/opnfv-artifact-repository.rst @@ -0,0 +1,80 @@ +TL;DR +----- + +Don't use git to store binary files that are built from source such as PDF files or Virtual Machine Images. + +What is Artifact Repository +--------------------------- + +An artifact repository is akin to what Subversion is to source code, i.e. it is a way of versioning code binary artifacts. In the Java world these artifacts could be jars, wars, ears, fully fledged applications, libraries or a collections of libraries that are packaged. (Read the rest from `the reference `_.) + +What will be used as Artifact Repository for OPNFV +-------------------------------------------------- + +It has been decided to use Google Storage as OPNFV Artifact Repository. + +This is due to not having enough storage in OPNFV infrastructure and installing/managing a robust Artifact Repository is not straightforward. + +Alternatives +------------ + +There are number of different alternatives that can serve as Artifact Repository Manager (ARM). + +Well known ones are + +* `JFrog Artifactory `_ +* `Sonatype Nexus `_ +* `Apache Archiva `_ +* `Swift `_ +* `Google Cloud Storage `_ + +What other OSS Projects Use +--------------------------- + +Different OSS Projects use different ARMs as listed below. + +* OpenDaylight: Sonatype Nexus. (provided by Linux Foundation.) `https://wiki.opendaylight.org/view/Infrastructure:Nexus `_. +* OpenStack: Uses tarball site. `http://tarballs.openstack.org/ `_. +* Apache: Sonatype Nexus. `https://repository.apache.org/ `_. + +Use of ARM in CI +---------------- + +Binaries/packages that are produced by CI can be deployed/uploaded to Artifact Repository making it possible to reuse artifacts during later stages of CI. They can be consumed by individual developers/organizations as well. + +Whatever is produced by CI can always be tracked by doing this when needed. + +Uploading artifacts using REST +------------------------------ + +Both Artifactory and Nexus provide REST APIs to upload/manipulate artifacts. Below are the links to some examples. + +* `How can I programatically upload an artifact into Nexus? `_ +* `Deploy Artifact to Artifactory `_ + +Uploading artifacts using Jenkins Plugins +----------------------------------------- + +Jenkins has number of plugins that offer integration of different ARMs. One of the examples is `Artifactory Plugin `_. + +Longer version +-------------- + +This is a summary of various email discussions on the topic of where to store large binary image files. Typical examples include videos, virtual machine images, software installers, ISOs for Operating Systems. + +Since many developers check their source code into the GIT repository it may seem natural to just place the files you've built into the repo too. This can work okay for a single developer working on a project over the weekends but with a team working on many components that need to be tested and integrated this won't scale. + +The way git works, no revision of any file is ever lost. So if you ever check in a big file, the repository will always contain it, and a git clone will be that much slower for every clone from that point onward. + +The golden rule of revision control systems applies: check in your build scripts, not your build products. + +Unfortunately, it only takes one person to start doing this and we end up with huge repositories. Please don't do this. It will make your computers sad. Thankfully, gerrit and code review systems are a massive disincentive to doing this. + +You definitely need to avoid storing binary images in git. This is what artifact repositories are for, like `Nexus or Artifactory `_ + +A “centralized image repository” is needed that can store multiple versions of various virtual machines and have something like /latest pointing to the newest uploaded image. It could be a simple nginx server that stores the output images from any jenkins job if it's successful, for instance. Any “client” would be able to fetch the latest “autorelease” using `https://server/image/latest `_ to get the latest image or `https://server/stcv/1.1 `_ and so on for any older image. + +For the specific project “vswitch performance characterization”, we have a directory as place holder to store the VM images. The VM images are not going to be in git repo. We use the same working git repository inside VM to run initial setup, and save the VM image in the host. + +TAG: GIT repository file download section + diff --git a/docs/opnfv-jjb-usage.rst b/docs/opnfv-jjb-usage.rst new file mode 100644 index 0000000..b7e0a49 --- /dev/null +++ b/docs/opnfv-jjb-usage.rst @@ -0,0 +1,164 @@ +Creating/Configuring/Verifying Jenkins Jobs +============================================ + +Clone the repo:: + + git clone ssh://YOU@gerrit.opnfv.org:29418/releng + +make changes:: + + git commit -sv + git review + remote: Resolving deltas: 100% (3/3) + remote: Processing changes: new: 1, refs: 1, done + remote: + remote: New Changes: + remote: https://gerrit.opnfv.org/gerrit/51 + remote: + To ssh://agardner@gerrit.opnfv.org:29418/releng.git + * [new branch] HEAD -> refs/publish/master + +Follow the link to gerrit https://gerrit.opnfv.org/gerrit/51 in a few moments the verify job will have completed and you will see Verified +1 jenkins-ci in the gerrit ui. + +If the changes pass the verify job https://build.opnfv.org/ci/view/builder/job/builder-verify-jjb/ The patch can be submitited by a committer. + +Job Types + +* Verify Job + + * Trigger: **recheck** or **reverify** + +* Merge Job + * Trigger: **remerge** + +The verify and merge jobs are retriggerable in Gerrit by simply leaving a comment with one of the keywords listed above. This is useful in case you need to re-run one of those jobs in case if build issues or something changed with the environment. + +You can add below persons as reviewers to your patch in order to get it reviewed and submitted. + +* Ulrich Kleber (Ulrich.Kleber@huawei.com) +* Fatih Degirmenci (fatih.degirmenci@ericsson.com) +* Xinyu Zhao(Jerry) (zhaoxinyu@huawei.com) + +Or just email a request for submission to opnfv-helpdesk@rt.linuxfoundation.org + +The Current merge and verify jobs for jenkins job builder as pulled from the repo:: + + - project: + name: builder-jobs + jobs: + - 'builder-verify-jjb' + - 'builder-merge' + + project: 'releng' + + - job-template: + name: builder-verify-jjb + + project-type: freestyle + + logrotate: + daysToKeep: 30 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + + wrappers: + - ssh-agent-credentials: + user: '{ssh-credentials}' + + triggers: + - gerrit: + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: 'releng' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/master' + file-paths: + - compare-type: ANT + pattern: jjb/** + - compare-type: ANT + pattern: jjb-templates/** + + + builders: + - shell: | + source /opt/virtualenv/jenkins-job-builder/bin/activate + jenkins-jobs test /opt/jenkins-ci/builder/ + + - job-template: + name: 'builder-merge' + + # builder-merge job to run JJB update + # + # This job's purpose is to update all the JJB + + project-type: freestyle + + logrotate: + daysToKeep: 30 + numToKeep: 40 + artifactDaysToKeep: -1 + artifactNumToKeep: 5 + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + choosing-strategy: 'default' + + wrappers: + - ssh-agent-credentials: + user: '{ssh-credentials}' + + triggers: + - gerrit: + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: 'releng' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/master' + file-paths: + - compare-type: ANT + pattern: jjb/** + + builders: + - shell: | + source /opt/virtualenv/jenkins-job-builder/bin/activate + cd /opt/jenkins-ci/releng + git pull + jenkins-jobs update --delete-old jjb/ + + diff --git a/docs/release/main.rst b/docs/release/main.rst new file mode 100644 index 0000000..7bfa94b --- /dev/null +++ b/docs/release/main.rst @@ -0,0 +1 @@ +Just a dummy file diff --git a/requirements/main.rst b/requirements/main.rst new file mode 100644 index 0000000..7bfa94b --- /dev/null +++ b/requirements/main.rst @@ -0,0 +1 @@ +Just a dummy file -- cgit 1.2.3-korg