sw360 / sw360portal

We have moved and *archived* this repository. Pls. continue at the new place at https://github.com/eclipse/sw360 ... A software component catalogue application - designed to work with FOSSology.
Other
35 stars 20 forks source link

Store attachments in external repository #639

Open bs-jokri opened 6 years ago

bs-jokri commented 6 years ago

From @bs-jokri on December 12, 2016 10:3

Instead of manually uploading the source code attachments into sw360, one wants to have the option to use an external repository for data-keeping. For this one might have to add an UI element, which allows on-demand adding of credentials.

Copied from original issue: bsinno/sw360#364

bs-jokri commented 6 years ago

From @maxhbr on December 12, 2016 15:40

e.g.: https://www.sonatype.com/products-sonatype

bs-jokri commented 6 years ago

This should work for

bs-jokri commented 6 years ago

https://www.jfrog.com/confluence/display/RTF/Installing+on+Linux+Solaris+or+Mac+OS

https://books.sonatype.com/nexus-book/reference/installing.html

bs-jokri commented 6 years ago

UC1 link release to artifact in repo

  1. create release 2.a. click add attachments 2.b. select artifact in external repo 2.b.1 give warning that artifact must be accessible by public 2.c. select attachment type 3 save

UC2. Use externally linked artifact in sw360 functionality (generate source code bundle, disc doc)

  1. start function
  2. check all attachments if repo requries password 2.a if pw required request from user (it could be that different repos can be )
  3. function reads attachment 2a if attachment is in external repo and requires password request password from user 2b buffer password
bs-jokri commented 6 years ago

From @maxhbr on January 25, 2017 15:50

Idea: add metadata for each repository and save url, and isPasswordRequired

bs-jokri commented 6 years ago

From @maxhbr on January 30, 2017 12:38

Nexus Sonatype:

rest API: https://oss.sonatype.org/nexus-restlet1x-plugin/default/docs/index.html

See: tmp

To test for existence:

Docker: https://hub.docker.com/r/sonatype/nexus/ Nexus3 pdf: https://books.sonatype.com/nexus-book/pdf3/nxbook-pdf.pdf

repositories

raw (at localhost:8081/repository/raw/)

url looks like localhost:8081/repository/raw/antlr4-4.6.tar.gz and basicAuth is requested.

bs-jokri commented 6 years ago

From @maxhbr on January 30, 2017 14:11

Artifactory:

AQL: https://www.jfrog.com/confluence/display/RTF/Artifactory+Query+Language Advanced REST: https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API

test setup

docker

$ docker pull docker.bintray.io/jfrog/artifactory-oss:latest
$ docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss:latest

curl api

upload

$ curl -uadmin:AP4aLhiuB6DKcDvv4no1qW3AVtt -T antlr4-4.6.tar.gz "http://localhost:8082/artifactory/generic-local/antlr4-4.6.tar.gz" 
{
  "repo" : "generic-local",
  "path" : "/antlr4-4.6.tar.gz",
  "created" : "2017-02-07T12:20:11.292Z",
  "createdBy" : "admin",
  "downloadUri" : "http://localhost:8082/artifactory/generic-local/antlr4-4.6.tar.gz",
  "mimeType" : "application/x-gzip",
  "size" : "3781141",
  "checksums" : {
    "sha1" : "c1a5f704ca598c421e9fa72f1db0499c1a17ad08",
    "md5" : "7b6d4f97a1b0f886c7656b70fa665fa9"
  },
  "originalChecksums" : {
  },
  "uri" : "http://localhost:8082/artifactory/generic-local/antlr4-4.6.tar.gz"
}

download

$ curl -uadmin:AP4aLhiuB6DKcDvv4no1qW3AVtt -O "http://localhost:8082/artifactory/generic-local/antlr4-4.6.tar.gz"                   
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3692k  100 3692k    0     0  53.2M      0 --:--:-- --:--:-- --:--:-- 53.8M
bs-jokri commented 6 years ago

From @maxhbr on February 7, 2017 10:8

Generic aproach

allow attachments do be stored in external repository and prevent syncing to SW360-couchdb. This implies that an Attachment has essentially three states

plus

Questions

(generic-) Problems

bs-jokri commented 6 years ago

From @maxhbr on June 21, 2017 8:15

upstream issue is https://github.com/sw360/sw360portal/issues/465

bs-jokri commented 6 years ago

From @maxhbr on July 7, 2017 12:0

Notes from discussion

bs-jokri commented 6 years ago

Text from duplicate issue https://github.com/sw360/sw360portal/issues/465

If one plans to sync data from an artifact repository server like Sonatype Nexus or Artifactory it would be redundant to save the source/binary attachments also in SW360. It might even be not possible due to the size of the attachments.

This could be solved by introducing remote attachments, which might be verified by their hash (which can be obtained from the repositories vie REST, or it could be provided for the upload).

bs-jokri commented 6 years ago

PR is still not upstream. Needs to be discussed what to do with that.

TristanFAURE commented 6 years ago

Hi any updates of this issue ? Really like the idea to link to nexus or artifactory

maxhbr commented 6 years ago

Sadly this is a realy hard issue, and we have encountered some unexpected problems, e.g.

In the sum that results in something which is very hard to accomplish.