Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FEDORA API #7

Merged
merged 67 commits into from
Sep 19, 2014
Merged

Add FEDORA API #7

merged 67 commits into from
Sep 19, 2014

Conversation

Hwesta
Copy link
Contributor

@Hwesta Hwesta commented Apr 15, 2014

Add support for depositing files from FEDORA, using SWORD2 as the API. See https://www.archivematica.org/wiki/Sword_API for the full spec.

Adds a new FEDORA Space, new 'FEDORA/SWORD Deposit' purpose for locations, and Deposit type of package. Pipelines now contain information for using the dashboard API. Also adds several models to track asynchronous downloads to a deposit.

Interactions described on wiki (and in code docstrings), but the API includes:

  • service document IRI (information about collections)
  • collection IRI (information about deposits, create new deposits)
  • deposit IRI (for getting information about the deposit, and finalizing it)
  • deposit media IRI (for posting new media to a specific deposit)

History cleaned up as best I can - more can be done if requested.

@@ -105,6 +107,7 @@ class Meta:
def prepend_urls(self):
return [
url(r"^(?P<resource_name>%s)/(?P<%s>\w[\w/-]*)/browse%s$" % (self._meta.resource_name, self._meta.detail_uri_name, trailing_slash()), self.wrap_view('browse'), name="browse"),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New newlines?

@mistydemeo
Copy link
Contributor

👍

@@ -5,7 +5,7 @@ install/storage etc/nginx/sites-available/
install/.storage-service var/archivematica/
install/make_key.py var/archivematica/storage-service/

#lib/* var/archivematica/storage-service/lib/
lib/* var/archivematica/storage-service/lib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this uncommented on purpose? There isn't a lib directory.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lib directory that is not under version control, that is
required in order for dh-virtualenv to be able to build packages on
launchpad.

The process of building a storage-service deb is this:

Update Debian/changelog
Run pip ( pip install -r requirements.txt -d lib )
Run debuild
Run dput

The lib directory is populated by pip. If the lib directory is not
included in the Debian install file, that directory will not be uploaded
to launchpad, and the build will fail, because it is not possible for pip
to fetch source from pypi via a launchpad server.

Possibly this needs to be documented a bit better, perhaps the build
process should itself be under version control.
On 13 Jun 2014 17:31, "Misty De Meo" notifications@github.com wrote:

In debian/archivematica-storage-service.install:

@@ -5,7 +5,7 @@ install/storage etc/nginx/sites-available/
install/.storage-service var/archivematica/
install/make_key.py var/archivematica/storage-service/

-#lib/* var/archivematica/storage-service/lib/
+lib/* var/archivematica/storage-service/lib/

Was this uncommented on purpose? There isn't a lib directory.


Reply to this email directly or view it on GitHub
https://github.com/artefactual/archivematica-storage-service/pull/7/files#r13777581
.

@qubot qubot closed this Aug 27, 2014
@qubot qubot deleted the dev/issue-5837-fedora-refactor branch August 27, 2014 17:40
@qubot qubot restored the dev/issue-5837-fedora-refactor branch August 27, 2014 17:50
@qubot qubot reopened this Aug 27, 2014
mcantelon and others added 25 commits September 18, 2014 12:17
refs #6232

Added the ability to start an additional batch downoad, using a
METS file, but posting METS data to the SWORD edit-iri endpoint.
Refactored code dealing with METS parsing and spawning batch
download jobs.
refs #6232

added the ability to mark a deposit complete before
async jobs are done.
refs #6232

Added logic so when finalization only is requested, it's performed
asynchronously. Added a field to the deposit to indicate when the
last attempt at finalization failed.
refs #6232

Added the abiliy to, by setting the HTTP "Packaging" header to "METS",
POST METS XML to the edit media IRI to start async batch uploads.
used when fetching files from a Fedora instance.
adding logging to basic auth
proof of concept
refs #6441
Added Fedora host, username, password fields to spaces for
SWORD-related functionality.
refs #5837

Move sword_error_response to helpers, update all references to point to
actual location.  Not all places calling currently have access to the
required request object.
Will need access to all models, so import the whole module instead of
individual classes.
Add description to packages, as a human-readable identifier.  Make
origin pipeline optional, as some packages (eg Transfers) may originate
from outside Archivematica.  Package path links to the Location it is
stored in.
Do not create a SWORD space for each pipeline.  User should create and
configure these if they need SWORD support.
refs #5796

Move fedora username/password/hostname to the FEDORA/SWORD specific
Space, instead of the common parent space.  Remove SWORD-specific
attributes from Package.  Add constants for FEDORA/SWORD deposits.
A deposit is more closely tied to a Package conceptually - a
file or collection of files to be moved around between Locations.
Locations are more associated with a purpose, and a logical grouping of
Packages.

Update resource endpoints to associate SWORD deposits with Packages,
and collections with Locations.  Move deposit related endpoints to
PackageResource, and pass a Package to the associated SWORD function.
Update DownloadTask & DownloadTaskFile to associate with Packages.
Update DownloadTask status function to return constants.
Update service document and GET/POST to collections, including all
dependent functions, for the Package and Locations changes.  Minor
refactoring, notably moving docstrings inside functions.
refs #5796

Add deposit finalization Package status, and set if finalization
successful.  Deposit from another location uses the same function as
ordinary deposits on finalization, and gets this change.  Do not
display finalized deposits in collection list.
Update deposit-related endpoints for model changes - list files, accept
new files, finalize, delete, state.  Delete PackageDownloadTasks and
PackageDownloadTaskFile when a file is deleted from a package.  Add
unicode names to models.  Minor refactoring, notably moving docstrings
inside functions.
refs #5796

A generic SWORD server would operate slightly differently, and
not required the fedora username/password.  Rename the space to
reflect this.

Update protocol constant, rename space and form, update all places that
reference those.
Add migration for FEDORA related changes.
@qubot qubot force-pushed the dev/issue-5837-fedora-refactor branch from dfe87fe to c817762 Compare September 18, 2014 19:44
@qubot qubot merged commit c817762 into qa/0.x Sep 19, 2014
@Hwesta Hwesta added this to the 0.5.0 and earlier milestone Apr 26, 2016
cole pushed a commit to cole/archivematica-storage-service that referenced this pull request Jun 28, 2017
See artefactual#7 and artefactual#9 for more details.

- storage_service.settings.test: disable whitenoise
- locations/fixtures/package.json: use json empty document default
- Dockerfile: add p7zip missing dependency
- Dockerfile: add workdir
- Dockerfile: add pythonpath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants