Kind Regards
Fraser.
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/847c993d-409d-4f01-8973-f2ba87d19655%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.
Whilst these are straight-forward capabilities of the UI, keep in mind we are auto-provisioning Nexus servers on the Cloud following an immutable server pattern i.e we create, use and destroy servers at will (we don't expect servers to be long-lived or maintain any state). This gets us to a standard automated 'base build' for Nexus. In addition, we provide tools for our distributed DevOps groups to automate their own repo's, groups, network shares and so on, again mostly using the REST API performing similar operations described above. These also need to be automated since they form part of the ability to recover a server to a defined state quickly, easily and in a repeatable way that we can easily wrap with a Continuous Integration or Continuous Delivery pipeline as/when we want to trigger it.
So, hopefully you can start to appreciate how central the API capability is to us and how important it is that we are able to continue using it as we consider migration to v3.
HTHs
Fraser.
Thanks, we appreciate your willingness to explain.
The importance of a REST API or ability to automate provisioning is known and understood. How that actually ends up becoming reality we are still working out. We want to ensure whatever we can do here will be stable, not not suffer problems NX2 had in terms of big bloated REST endpoints (which were mainly intended for the UI to consume).
Provisioning however, IMO, is a complex multi-entity/multi-service dance to wire up properly, consistency and sanely… which I’m not sure that REST is very well suited for, unless there was a single end-point to essentially take the full provisioning instructions to apply/commit at once...
One concept I’m considering, which we already use to some degree for development, is to use a script to execute on the server, where that script can lookup the right service abstractions, construct the right configuration and commit it all in one go, w/o a complex request client-driven process.
* * *
Nothing here is set in stone, but I’m curious if you could imagine a provisioning script as a simpler option to setup your environment as a feasible alternative (in the short-term at least, but perhaps long-term as well) over needing to perform multiple REST requests to configure the instance for your requirements?
FTR this is a script that runs “inside the server” and has full access to all of the public service apis and thus can very quickly and efficiently configure all aspects of the server. NX3 already has as ‘nexus:groovy’ shell command to facilitate this, refined in upcoming version as ‘nexus:script’ command which can support any javax.script engine available (which is groovy and then whatever your JRE comes with, usually just ‘javascript’, though groovy is our preferred means to script and likely will be the language recommended or used for examples FYI).
I’m 100% sure we’ll be building a REST API as well, but the above technique is nearly immediately useful for automated provisioning… sans the documentation of what the public apis are…. which is also something we are planning on ensuring is stable, documented and comprehensive.
Thanks,
—jason
> Nothing here is set in stone, but I’m curious if you could imagine a provisioning script as a simpler option to setup your environment as a feasible alternative
> (in the short-term at least, but perhaps long-term as well) over needing to perform multiple REST requests to configure the instance for your requirements?
Absolutely, the smaller the number of moving parts and external dependencies the better.
Are you able to provide more details and some examples ?
Nothing official yet, but here is a simple example showing repository creation, for latest 3.0.0-M6 release, to give you a basic idea of the concept:
First you have to enable the local shell (its disabled by default ATM), by editing:
bin/nexus.vmoptions and change the ‘karaf.startLocalConsole’ property to true:
<snip>
-Dkaraf.startLocalConsole=true
</snip>
Then start nexus with the ‘run’ option to get access to the local shell:
<snip>
bin/nexus run
</snip>
Once NX reports its started, you can just hit ENTER to redisplay the “karaf@root()>" prompt, which gets overwritten by boot logging.
Save this snip to a file:
<snip file="<path-to>/create_repo.groovy">
import org.sonatype.nexus.repository.config.Configuration
import org.sonatype.nexus.repository.manager.RepositoryManager
def manager = container.lookup(RepositoryManager.class.name)
manager.create(new Configuration(
repositoryName: 'test-maven-hosted-release',
recipeName: 'maven2-hosted',
online: true,
attributes: [
maven: [
versionPolicy: 'RELEASE',
layoutPolicy: 'STRICT'
],
storage: [
blobStoreName: 'default',
writePolicy: 'ALLOW_ONCE'
]
]
))
</snip>
And in the shell execute the ‘nexus:groovy’ command:
<snip>
nexus:groovy <path-to>/create_repo.groovy
</snip>
This may burp-up some logging about baseurl you can ignore, and then spits out something like:
<snip>
Name test-maven-hosted-release
Type hosted
Configuration Configuration{repositoryName='test-maven-hosted-release', recipeName='maven2-hosted', attributes={maven={versionPolicy=RELEASE, layoutPolicy=STRICT}, storage={blobStoreName=default, writePolicy=ALLOW_ONCE}}}
Format maven2
</snip>
^^^ above is the Karaf shell trying to interpret the return result of the script, which in this case is the reference to the created Repository object implicitly returned by groovy as the last statements return value.
This is just a simple example showing a single repository creation, but hopefully you could imagine how multiple repos, or other configuration can be applied within a more complex script providing the provisioning logic your environment requires.
We use similar technique to avoid having to go clicking around a ton to re-setup environment for development or testing. It is as of yet not something we support, but this is along the lines I’m currently thinking for advanced provisioning systems (which we’d likely use ourselves to provision oss.sonatype.org once its updated, to NX3 etc).
Result is after this runs you can see a repository was created in the server, and its now online and ready to serve requests:

A REST API is still a requirement for ad hoc GETs and PUTs though. All kinds of use cases for those.
Do you have actual use-cases for this? Can you give me some real examples of what ad-hock GET or PUT you are referring to here please?
Thanks!
—jason
As for other use cases beyond the base level install, ... come on Jason, there are any number activities that we might want to perform against Nexus in the context of another application, just like may people do already from 2.x. We may want to upload artefacts, query repos, groups and specific assets, assign metadata to assets, and so on. Some of those applications may have to do with software development, others are required to support security audit and all manner of other processes. Either way, they require integration with Nexus via an API and REST would be our preferred option especially internally where network latency is much less of an issue.
Keep in mind that whilst the most common repo type is likely Maven2, in my case we are a long way from being a Java shop, so all of the other repo types are definitely in play and will likely form the majority of artefacts that we hold. Indeed one of the reasons we are enthusiastic for the GA for v3 are the Docker and 'raw' repo types.
We also make a lot of use of Nuget repos both for in-house Nuget packages that support distributed software development and release, as well as Chocolatey installation packages. Similarly with 'raw' repos for assets that have no specialised type.
All of the above activities (and more) are part of everyday software engineering practice that spans application development to DevOps. Many are implemented via CI workflows and as many as possible are fully automated, so manual interaction with the Nexus application is minimal.
What's the anticipated GA for v3 ?
HTHs
Fraser.
Thanks for the example. Typically we would want to locate assets off the Nexus server on a network share such as AWS EFS, does the object model that you showed above support over-riding the location as in 2.x ?
Yes, in NX3 this is part of the blobstore abstraction. Example I showed was using the ‘default’ blobstore, to relocate content to another location you would need to configure a new blobstore (or use a previously configured blobstore) and instead of ‘default’ use the name of this blobstore to inform the repository where to store contents.
Indeed one of the reasons we are enthusiastic for the GA for v3 are the Docker and 'raw' repo types.
Interesting, what about ‘raw’ makes you enthusiastic? This is a bit of a surprise.
—jason
Fraser.
Hi,
I think this a very valid discussion and Fraser is making very good points:
a. DevOps requirements for Nexus - if to be taken seriously - shouldn't be restricted to the Java / Maven perspective. Specifically DevOps needs to be able to move efficiently in heterogeneous world, even if "mainstream" development is done in Java. There is always code you don't want to or can't do in Java.
b. DevOps has specific requirements in the supply chain from development to delivery, which necessarily need to be automated and adapted to company specific requirements. Also Nexus is only one piece in a whole chain of tools, which need to collaborate in the process. One way to do this would certainly be a Restful API of Nexus , which also would be my first "guess" .....
I' m a little astonished that both requirements seem to come as a surprise?
So asking the other way around: how does nexus3 envision to support company specific requirements for automation of provisioning and delivery of artifacts ? The background of my question is that we are planning a major "upgrade" of our build & delivery processes.
Best regards
Christoph
Hi,
I think this a very valid discussion and Fraser is making very good points:
a. DevOps requirements for Nexus - if to be taken seriously - shouldn't be restricted to the Java / Maven perspective. Specifically DevOps needs to be able to move efficiently in heterogeneous world, even if "mainstream" development is done in Java. There is always code you don't want to or can't do in Java.
b. DevOps has specific requirements in the supply chain from development to delivery, which necessarily need to be automated and adapted to company specific requirements. Also Nexus is only one piece in a whole chain of tools, which need to collaborate in the process. One way to do this would certainly be a Restful API of Nexus , which also would be my first "guess" .....
I' m a little astonished that both requirements seem to come as a surprise?
Its not a surprise.
If you would like to contribute some specific use cases you have please feel free.
—jason
We use the REST API to search for artifacts and retrieve their specific details for inclusion in constructed release notes.
I'm presuming that because tools such as Eclipse Maven integration will use those kind of search and retrieval features that this is something which won't be going away in v3.
Dg.
--
David Grierson - SDLC Tools Specialist
Sky Broadcasting - Customer Business Systems - SDLC Tools
Email: david.g...@sky.uk
Watermark Building, Alba Campus, Livingston, EH54 7HH
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
nexus-users...@glists.sonatype.com.
To post to this group, send email to
nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/etPan.5652def0.2d6b7c8d.5a1%40Lust.local.
For more options, visit
https://groups.google.com/a/glists.sonatype.com/d/optout.
Is there *anything* that you can point me to that describes what services and resources are [likely to be] available and their respective endpoint URIs and payloads, so I can begin this work ?
I don't mind if it's still in alpha/beta whatever, it's just so central to the way that we provision Nexus in our Cloud and in containers (included user defined repos and groups) that its become a blocker issue to making any significant progress (I appreciate the insight into using groovy, but that doesn't really cover all of the use case we have).
At this stage, even just the basics would be enough to move forwards. For example, creating repos, groups, assigning repos to groups, and core configuration (such as setting proxies, work location etc ...).
Very happy to work with Sonatype and this forum in testing and providing feedback for what you have now on the HTTP/REST API and as this progresses through whatever milestone releases remain before GA.
Can you help me out here ?
Regards
Fraser.
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/bbc45d00-bfc7-42d1-88e1-5174703fcafd%40glists.sonatype.com.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CAJ6jfGEOrcHOqBw6CbUyW5Fk%2BPVLoG7bchLksiynFBgJZGCuBw%40mail.gmail.com.
I'm not suggesting that the v2 API is perfect, few designs in software
are. No my argument is that (a) for an initial MVP release its
shouldn't be too difficult to define the standard set of RESTful verbs
over the core Nexus resources. I would be surprised if that would be
contraversial. That I suspect will satisfy a good many use cases,
certainly nearly all of mine. The other edge cases can come later.
As for performance, that's an entirely separate concern (i.e. It's an
optimisation) that doesn't need to hold back the delivery of the API
which after all is simply an abstraction.
Most of us in our professional life would like a bit more time to
perfect our design and implementation, but most times we need to
deliver against the commercial pressures that exist and work in an
agile way. Abstractions (including APIs) help here. I haven't heard
any compelling argument that suggests such a delay is justified. The
API can't be an after-thought, rather one of the first architectural
constructs surely ?
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CAJ6jfGFoq1KTiwmtvSROM%3D1QVCpsKRJLZLd5joE1%2BPpqSR-Hwg%40mail.gmail.com.
Brian,
As I expected, so how about a v3 MVP that includes a minimal API that
includes just the base resources then ? Surely that minimal set are
not controversial are they ?, and for those who prefer to wait for
more conveniently wrapped resources .. well, as you have suggested,
these will be along in due course, no need to make everyone wait ?
From other threads on this subject and your own comments, I am clearly
not the only one who views this as an essential prior to migration.
My company currently make extensive use of the REST API and the Atlassian Puppet module for v2.11.x but we are anxious to get more information regarding v3 so we can plan migration ASAP. Does anyone know whether any documentation exists (I have emailed Sonatype but haven't heard back from them).Kind Regards
Fraser.
Hi,
Hi Manfred,
The upcoming 3.1 release focusses on migration from 2.x to 3.x and Nexus Pro features in 3.x. Currently the plan is for a following release later this year to introduce the new REST API. Feature wise we welcome any suggestions or reqirements from your end. We already have a pretty good idea what is needed from usage of the old API as well as the existing scripting API that is ready to be used now. You should check it out.
http://www.sonatype.org/nexus/2016/06/08/integrating-nexus-repository-3/
http://books.sonatype.com/nexus-book/3.0/reference/scripting.html
Manfred
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/aa8eaa11-3e68-4831-8856-d8da31b7b989%40glists.sonatype.com.
Hi Manfred,
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CAJ6jfGHaqXBwijT5cC-_CRQFW5HCX_KKBQDLFXar0F0Qoa4dYA%40mail.gmail.com.
I whole-heartedly agree that migration is an absolute must have, and
frankly was shocked that it wasn't included with the 3.0 release,
although that would likely have required a higher level of feature
parity.
I'm all for expansion of the range of features but personally would
have liked to have seen a focus on like-for-like existing
functionality before moving on to other areas. I don't suppose 100% of
users needed a docker registry or support for some of the other new
feed types, but they made it in (and judging by the recent webcast
will continue to be added at a pace ?).Actually better Yum support
would be my first choice.
I guess I was looking for an upgrade that made it easy to move to
without having to maintain two versions for an indeterminate period,
unless that is, you are willing to share more specifically the roadmap
timetable ? It's clear from the questions that frequently come up,
that the community is still unsure when each of our items of interest
will land and 'xxx is nearing the top of the list' doesn't really work
for my bosses and nor I would guess, anyone else's.
I don't recall ever asking for CRUD for all objects and certainly
don't need that either. The groovy approach is OK up to a point. It's
all we have for now, but like many things it's hard to reason about
how much effort to expend on something without having much of an idea
when other (perhaps preferable) approaches might be available.
Perhaps if you could expand on how you view the primary use cases for
the functionality provided by Groovy scripting and the TBA REST API
are differentiated. Maybe that will help me understand better the
priorities that have been chosen ?