Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
0642fa79
Commit
0642fa79
authored
6 years ago
by
Bastien Abadie
Browse files
Options
Downloads
Plain Diff
Merge branch 's3-fixes' into 'master'
S3 workflow fixes See merge request
!263
parents
2be1287e
15b7e213
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!263
S3 workflow fixes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arkindex/dataimport/tasks/base.py
+1
-1
1 addition, 1 deletion
arkindex/dataimport/tasks/base.py
arkindex/images/models.py
+7
-0
7 additions, 0 deletions
arkindex/images/models.py
arkindex/project/settings.py
+4
-1
4 additions, 1 deletion
arkindex/project/settings.py
with
12 additions
and
2 deletions
arkindex/dataimport/tasks/base.py
+
1
−
1
View file @
0642fa79
...
...
@@ -57,7 +57,7 @@ def populate_volume(volume, files):
# Build page with image
page
=
import_page
(
volume
,
img
,
volume
.
name
)
page
.
events
.
create
(
type
=
EventType
.
Addition
)
pages
.
append
((
page
,
staging_path
))
pages
.
append
((
page
,
img
.
s3_url
))
assert
len
(
pages
)
>
0
,
'
No imported pages
'
logger
.
info
(
"
Imported {} pages into {}
"
.
format
(
len
(
pages
),
volume
.
name
))
...
...
This diff is collapsed.
Click to expand it.
arkindex/images/models.py
+
7
−
0
View file @
0642fa79
...
...
@@ -211,6 +211,13 @@ class Image(IndexableModel):
assert
self
.
server
.
is_local
,
'
Cannot load images on remote image servers via S3
'
return
s3
.
Object
(
settings
.
AWS_IIIF_BUCKET
,
urllib
.
parse
.
unquote
(
self
.
path
))
@property
def
s3_url
(
self
):
return
s3
.
meta
.
client
.
generate_presigned_url
(
'
get_object
'
,
Params
=
{
'
Bucket
'
:
self
.
s3_object
.
bucket_name
,
'
Key
'
:
self
.
s3_object
.
key
,
})
def
exists
(
self
):
"""
Returns whether the Image exists on the IIIF S3 bucket by performing a HEAD request to S3.
...
...
This diff is collapsed.
Click to expand it.
arkindex/project/settings.py
+
4
−
1
View file @
0642fa79
...
...
@@ -59,7 +59,7 @@ if not os.path.isdir(MEDIA_ROOT):
# Local IIIF server
LOCAL_IMAGESERVER_ROOT
=
os
.
environ
.
get
(
'
LOCAL_IMAGESERVER_ROOT
'
,
os
.
path
.
join
(
BASE_DIR
,
'
iiif-users
'
))
LOCAL_IMAGESERVER_ID
=
os
.
environ
.
get
(
'
LOCAL_IMAGESERVER_ID
'
,
1
)
LOCAL_IMAGESERVER_ID
=
int
(
os
.
environ
.
get
(
'
LOCAL_IMAGESERVER_ID
'
,
1
)
)
HOST_LOCAL_IMAGESERVER_ROOT
=
os
.
environ
.
get
(
'
HOST_LOCAL_IMAGESERVER_ROOT
'
,
LOCAL_IMAGESERVER_ROOT
)
# Extra initial data for scripts
...
...
@@ -115,7 +115,10 @@ else:
'
S3SOURCE_ACCESS_KEY_ID
'
:
AWS_ACCESS_KEY
,
'
S3SOURCE_SECRET_KEY
'
:
AWS_SECRET_KEY
,
'
S3SOURCE_ENDPOINT
'
:
AWS_ENDPOINT
,
'
S3SOURCE_BASICLOOKUPSTRATEGY_BUCKET_NAME
'
:
AWS_IIIF_BUCKET
,
'
AWS_THUMBNAIL_BUCKET
'
:
AWS_THUMBNAIL_BUCKET
,
'
AWS_STAGING_BUCKET
'
:
AWS_STAGING_BUCKET
,
'
AWS_REGION
'
:
AWS_REGION
,
},
'
network
'
:
'
arkindex_default
'
,
'
links
'
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment