sonatype-nexus-community/nexus-blobstore-google-cloud

Name: nexus-blobstore-google-cloud

Owner: Sonatype Community

Description: null

Created: 2018-05-08 14:40:19.0

Updated: 2018-05-17 18:09:12.0

Pushed: 2018-05-17 18:09:14.0

Homepage: null

Size: 93

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Nexus Repository Google Cloud Storage Blobstore

Build Status Join the chat at https://gitter.im/sonatype/nexus-developers

This project adds Google Cloud Object Storage backed blobstores to Sonatype Nexus Repository 3. It allows Nexus Repository to store the components and assets in Google Cloud instead of a local filesystem.

Contribution Guidelines

Go read our contribution guidelines to get a bit more familiar with how we would like things to flow.

Requirements

Also, there is a good amount of information available at Bundle Development Overview

Building

To build the project and generate the bundle use Maven:

mvn clean install
Installing

After you have built the project, copy the jar and feature into the nexus install (rooted at NEXUS_HOME with NEXUS_VERSION being 3.6.0 or later):

r -p ${NEXUS_HOME}/system/org/sonatype/nexus/plugins/nexus-blobstore-google-cloud/0.2.0-SNAPSHOT
/target/feature/feature.xml \
NEXUS_HOME}/system/org/sonatype/nexus/plugins/nexus-blobstore-google-cloud/0.2.0-SNAPSHOT/nexus-blobstore-google-cloud-0.2.0-SNAPSHOT-features.xml
/target/nexus-blobstore-google-cloud-0.2.0-SNAPSHOT.jar \
NEXUS_HOME}/system/org/sonatype/nexus/plugins/nexus-blobstore-google-cloud/0.2.0-SNAPSHOT/

Edit ${NEXUS_HOME}/etc/karaf/org.ops4j.pax.url.mvn.cfg and change the last line so it can fetch dependencies from central:

ops4j.pax.url.mvn.repositories=https://repo1.maven.org/maven2@id=central

Edit ${NEXUS_HOME}/etc/karaf/org.apache.karaf.features.cfg and add this entry to the end of the comma-separated list labeled featuresRepositories:

org.sonatype.nexus.plugins/nexus-blobstore-google-cloud/0.2.0-SNAPSHOT/xml/features

Edit ${NEXUS_HOME}/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}/nexus-core-feature-${NEXUS_VERSION}-features.xml:

ture version="0.2.0-SNAPSHOT" prerequisite="false" dependency="false">nexus-blobstore-google-cloud</feature>

That line should be added at about line 14, directly after:

ture version="3.11.0" prerequisite="false" dependency="false">nexus-task-log-cleanup</feature>
Google Cloud Storage Permissions

Next, you will need to create an account with appropriate permissions.

Of the predefined account roles, Storage Admin will grant the plugin to create any Google Cloud Storage Buckets you require and administer all of the objects within, but it will also have access to manage any other Google Cloud Storage Buckets associated with the project.

If you are using custom roles, the account will need:

  1. (required) storage.objects.*
  2. (required) storage.buckets.get
  3. or storage.buckets.*.

If you only provide permissions 1 and 2, you will have to create any Google Cloud Storage Buckets in advance of assigning them to Nexus Repository Manager blob stores. The third option will allow the plugin to create buckets for you.

If you are creating the Google Cloud Storage Buckets in advance, you should use either the 'Multi-Regional' or 'Regional' storage class; 'Nearline' and 'Coldline' are not suitable for Nexus Repository Manager workloads. If you let the plugin create the bucket, it will use the 'Multi-Regional' storage class.

Google Cloud Storage Authentication

Per the Google Cloud documentation:

  1. Generate a JSON Service Account key
  2. Store this file on the filesystem with appropriate permissions for the user running Nexus to read it.
  3. (optional, but recommended) Set the GOOGLE_APPLICATION_CREDENTIALS environment variable for the user running Nexus:
rt GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json
Configuration

A restart of Nexus Repository Manager is required to complete the installation process.

Log in as admin and create a new blobstore, selecting 'Google Cloud Storage' as the type.

If you did not set the environment variable in Step 3 above, specify the absolute path to the JSON Service Account key file.

The Fine Print

It is worth noting that this is NOT SUPPORTED by Sonatype, and is a contribution of ours to the open source community (read: you!)

Remember:

Phew, that was easier than I thought. Last but not least of all:

Have fun creating and using this plugin and the Nexus platform, we are glad to have you here!

Getting help

Looking to contribute to our code but need some help? There's a few ways to get information:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.