1 ===========================
2 OPNFV Artifact Repository
3 ===========================
8 What is Artifact Repository
9 ---------------------------
11 An Artifact Repository is akin to what Subversion is to source code, i.e.
12 it is a way of versioning artifacts produced by build systems, CI, and so on. [1]
14 Why Artifact Repository is Needed
15 ---------------------------------
17 Since many developers check their source code into the GIT repository it may seem natural
18 to just place the files you've built into the repo too.
19 This can work okay for a single developer working on a project over the weekends
20 but with a team working on many components that need to be tested and integrated, this won't scale.
22 The way git works, no revision of any file is ever lost.
23 So if you ever check in a big file, the repository will always contain it,
24 and a git clone will be that much slower for every clone from that point onward.
26 The golden rule of revision control systems applies:
27 *check in your build scripts, not your build products*.
29 Unfortunately, it only takes one person to start doing this and we end up with huge repositories.
30 Please don't do this. It will make your computers sad.
31 Thankfully, Gerrit and code review systems are a massive disincentive to doing this.
33 You definitely need to avoid storing binary images in git. This is what artifact repositories are for. [2]
35 A “centralized image repository” is needed that can store multiple versions of various virtual machines
36 and have something like /latest pointing to the newest uploaded image.
37 It could be a simple nginx server that stores the output images from any jenkins job if it's successful, for instance.
39 OPNFV Artifact Repository
40 =========================
42 What is used as Artifact Repository for OPNFV
43 ---------------------------------------------
45 Setting up, hosting, and operating an artifact repository on OPNFV Infrastructure
46 in Linux Foundation (LF) environment requires too much storage space.
47 It is also not a straightforward undertaking to have robust Artifact Repository and provide 24/7 support.
49 OPNFV Project decided to use **Google Cloud Storage** as OPNFV Artifact Repository due to reasons summarized above. [3]
51 Usage of Artifact Repository in OPNFV CI
52 ----------------------------------------
54 Binaries/packages that are produced by OPNFV Continuous Integration (CI) are deployed/uploaded
55 to Artifact Repository making it possible to reuse artifacts during later stages of OPNFV CI.
56 Stored artifacts can be consumed by individual developers/organizations as well.
58 In OPNFV, we generally produce PDF, ISO and store them on OPNFV Artifact Repository.
60 OPNFV Artifact Repository Web Interface
61 ----------------------------------------
63 OPNFV Artifact Repository is accessible via link http://artifacts.opnfv.org/.
65 A proxy has been set up by LF for the community members located in countries with access restrictions to Google http://build.opnfv.org/artifacts/.
67 Access Rights to OPNFV Artifact Repository
68 ==========================================
70 As summarized in previous sections, OPNFV uses Google Cloud Storage as Artifact Repository.
71 By default, everyone has read access to it and artifacts can be fetched/downloaded using browser,
72 a curl-like command line HTTP client, or gsutil.
74 Write access to Artifact Repository is given per request basis and all the requests
75 must go through `LF Helpdesk <opnfv-helpdesk@rt.linuxfoundation.org>`_ with an explanation
76 regarding the purpose of write access.
77 Once you are given write access, you can read corresponding section to store artifacts on OPNFV Artifact Repository.
79 How to Use OPNFV Artifact Repository
80 ====================================
82 There are 3 basic scenarios to use OPNFV Artifact repository.
85 * downloading artifacts
88 Please see corresponding sections regarding how to do these.
90 How to Browse Artifacts Stored on OPNFV Artifact Repository
91 -----------------------------------------------------------
93 You can browse stored artifacts using
95 * **Web Browser**: By navigating to the address `OPNFV Artifact Storage <http://artifacts.opnfv.org/>`_.
97 * **Command Line HTTP-client**
98 ``curl -o <output_filename> http://artifacts.opnfv.org``
102 ``curl -o opnfv-artifact-repo.html http://artifacts.opnfv.org``
104 * **Google Storage Util (gsutil)**
105 ``gsutil ls gs://artifacts.opnfv.org/<path_to_bucket>``
109 ``gsutil ls gs://artifacts.opnfv.org/octopus``
111 How to Download Artifacts from OPNFV Artifact Repository
112 --------------------------------------------------------
114 You can download stored artifacts using
116 * **Web Browser**: By navigating to the address `OPNFV Artifact Storage <http://artifacts.opnfv.org/>`_ and clicking the link of the artifact you want to download.
118 * **Command Line HTTP-client**
119 ``curl -o <output_filename> http://artifacts.opnfv.org/<path/to/artifact>``
123 ``curl -o main.pdf http://artifacts.opnfv.org/octopus/docs/release/main.pdf``
125 * **Google Storage Util (gsutil)**
126 ``gsutil cp gs://artifacts.opnfv.org/<path/to/artifact> <output_filename>``
130 ``gsutil cp gs://artifacts.opnfv.org/octopus/docs/release/main.pdf main.pdf``
132 How to Upload Artifacts to OPNFV Artifact Repository
133 ----------------------------------------------------
135 As explained in previous sections, you need to get write access for OPNFV Artifact Repository
136 in order to upload artifacts.
138 Apart from write access, you also need to have Google account and have the
139 Google Cloud Storage utility, **gsutil**, installed on your computer.
141 Install and Configure gsutil
142 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144 Please follow steps listed below.
148 Please follow steps listed on `this link <https://cloud.google.com/storage/docs/gsutil_install>`_ to install gsutil to your computer.
152 Issue below command and follow the instructions. You will be asked for the project-id.
153 The project-id is **linux-foundation-collab**.
157 3. Request write access for OPNFV Artifact Repository
159 Send an email to `LF Helpdesk <opnfv-helpdesk@rt.linuxfoundation.org>`_ and list the reasons for the request. Do not forget to include gmail mail address.
164 Once you installed and configured gsutil and got write access from LF Helpdesk,
165 you should be able to upload artifacts to OPNFV Artifact Repository.
167 The command to upload artifacts is
169 ``gsutil cp <file_to_upload> gs://artifacts.opnfv.org/<path/to/bucket>``
173 ``gsutil cp README gs://artifacts.opnfv.org/octopus``
175 Once the upload operation is completed,
176 you can do the listing and check to see if the artifact is where it is expected to be.
178 ``gsutil ls gs://artifacts.opnfv.org/<path/to/bucket>``
182 ``gsutil ls gs://artifacts.opnfv.org/octopus``
187 Send an email to `LF Helpdesk <opnfv-helpdesk@rt.linuxfoundation.org>`_ or join the channel **#opnfv-octopus** on IRC.
191 1. `Why you should be using an Artifact Repository <http://blogs.collab.net/subversion/why-you-should-be-using-an-artifact-repository-part-1>`_
192 2. `Regarding VM image and Git repo <http://lists.opnfv.org/pipermail/opnfv-tech-discuss/2015-January/000591.html>`_
193 3. `Google Cloud Storage <https://cloud.google.com/storage/>`_