Skip to content

Commit 1a42013

Browse files
authored
Merge pull request #108 from clowder-framework/release/1.12.0
Release/1.12.0
2 parents 3df9434 + 6cf078f commit 1a42013

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2565
-386
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ jobs:
3333
- uses: actions/checkout@v2
3434
- name: github branch
3535
run: |
36-
BRANCH=${GITHUB_REF##*/}
37-
echo "::set-env name=GITHUB_BRANCH::${BRANCH}"
36+
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
37+
BRANCH="${{ github.event.release.target_commitish }}"
38+
else
39+
BRANCH=${GITHUB_REF##*/}
40+
fi
41+
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
3842
if [ "$BRANCH" == "master" ]; then
39-
echo "::set-env name=CLOWDER_VERSION::$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
43+
echo "CLOWDER_VERSION=$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')" >> $GITHUB_ENV
4044
elif [ "$BRANCH" == "develop" ]; then
41-
echo "::set-env name=CLOWDER_VERSION::develop"
45+
echo "CLOWDER_VERSION=develop" >> $GITHUB_ENV
4246
else
43-
echo "::set-env name=CLOWDER_VERSION::testing"
47+
echo "CLOWDER_VERSION=testing" >> $GITHUB_ENV
4448
fi
4549
- uses: actions/setup-java@v1
4650
with:
@@ -83,14 +87,18 @@ jobs:
8387
- uses: actions/checkout@v2
8488
- name: github branch
8589
run: |
86-
BRANCH=${GITHUB_REF##*/}
87-
echo "::set-env name=GITHUB_BRANCH::${BRANCH}"
90+
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
91+
BRANCH="${{ github.event.release.target_commitish }}"
92+
else
93+
BRANCH=${GITHUB_REF##*/}
94+
fi
95+
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
8896
if [ "$BRANCH" == "master" ]; then
89-
echo "::set-env name=CLOWDER_VERSION::$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
97+
echo "CLOWDER_VERSION=$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')" >> $GITHUB_ENV
9098
elif [ "$BRANCH" == "develop" ]; then
91-
echo "::set-env name=CLOWDER_VERSION::develop"
99+
echo "CLOWDER_VERSION=develop" >> $GITHUB_ENV
92100
else
93-
echo "::set-env name=CLOWDER_VERSION::testing"
101+
echo "CLOWDER_VERSION=testing" >> $GITHUB_ENV
94102
fi
95103
- uses: actions/setup-java@v1
96104
with:
@@ -123,14 +131,18 @@ jobs:
123131
- uses: actions/checkout@v2
124132
- name: github branch
125133
run: |
126-
BRANCH=${GITHUB_REF##*/}
127-
echo "::set-env name=GITHUB_BRANCH::${BRANCH}"
134+
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
135+
BRANCH="${{ github.event.release.target_commitish }}"
136+
else
137+
BRANCH=${GITHUB_REF##*/}
138+
fi
139+
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
128140
if [ "$BRANCH" == "master" ]; then
129-
echo "::set-env name=CLOWDER_VERSION::$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
141+
echo "CLOWDER_VERSION=$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')" >> $GITHUB_ENV
130142
elif [ "$BRANCH" == "develop" ]; then
131-
echo "::set-env name=CLOWDER_VERSION::develop"
143+
echo "CLOWDER_VERSION=develop" >> $GITHUB_ENV
132144
else
133-
echo "::set-env name=CLOWDER_VERSION::testing"
145+
echo "CLOWDER_VERSION=testing" >> $GITHUB_ENV
134146
fi
135147
- uses: actions/setup-java@v1
136148
with:
@@ -185,14 +197,18 @@ jobs:
185197
- uses: actions/checkout@v2
186198
- name: github branch
187199
run: |
188-
BRANCH=${GITHUB_REF##*/}
189-
echo "::set-env name=GITHUB_BRANCH::${BRANCH}"
200+
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
201+
BRANCH="${{ github.event.release.target_commitish }}"
202+
else
203+
BRANCH=${GITHUB_REF##*/}
204+
fi
205+
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
190206
if [ "$BRANCH" == "master" ]; then
191-
echo "::set-env name=CLOWDER_VERSION::$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
207+
echo "CLOWDER_VERSION=$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')" >> $GITHUB_ENV
192208
elif [ "$BRANCH" == "develop" ]; then
193-
echo "::set-env name=CLOWDER_VERSION::develop"
209+
echo "CLOWDER_VERSION=develop" >> $GITHUB_ENV
194210
else
195-
echo "::set-env name=CLOWDER_VERSION::testing"
211+
echo "CLOWDER_VERSION=testing" >> $GITHUB_ENV
196212
fi
197213
- uses: actions/setup-java@v1
198214
with:

.github/workflows/docker.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ jobs:
6565
# calculate some variables that are used later
6666
- name: github branch
6767
run: |
68-
BRANCH=${GITHUB_REF##*/}
69-
echo "::set-env name=GITHUB_BRANCH::${BRANCH}"
68+
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
69+
BRANCH="${{ github.event.release.target_commitish }}"
70+
else
71+
BRANCH=${GITHUB_REF##*/}
72+
fi
73+
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
7074
if [ "$BRANCH" == "master" ]; then
7175
version="$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
7276
tags="latest"
@@ -76,14 +80,14 @@ jobs:
7680
tags="${tags},${version}"
7781
version=${version%.*}
7882
done
79-
echo "::set-env name=CLOWDER_VERSION::$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')"
80-
echo "::set-env name=CLOWDER_TAGS::${tags}"
83+
echo "CLOWDER_VERSION=$(awk '/version = / { print $4 }' project/Build.scala | sed 's/"//g')" >> $GITHUB_ENV
84+
echo "CLOWDER_TAGS=${tags}" >> $GITHUB_ENV
8185
elif [ "$BRANCH" == "develop" ]; then
82-
echo "::set-env name=CLOWDER_VERSION::develop"
83-
echo "::set-env name=CLOWDER_TAGS::develop"
86+
echo "CLOWDER_VERSION=develop" >> $GITHUB_ENV
87+
echo "CLOWDER_TAGS=develop" >> $GITHUB_ENV
8488
else
85-
echo "::set-env name=CLOWDER_VERSION::testing"
86-
echo "::set-env name=CLOWDER_TAGS::"
89+
echo "CLOWDER_VERSION=testing" >> $GITHUB_ENV
90+
echo "CLOWDER_TAGS=" >> $GITHUB_ENV
8791
fi
8892
8993
# build the docker image, this will always run to make sure

CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,38 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.12.0 - 2020-10-19
8+
**_Warning:_**
9+
- This update modifies the MongoDB schema. Make sure to start the application with `-DMONGOUPDATE=1`.
10+
- This update modifies information stored in Elasticsearch used for text based searching. Make sure to initiate a reindex
11+
of Elasticsearch from the Admin menu or by `POST /api/reindex`.
12+
13+
### Added
14+
- Global extractors page now shows more information, including submission metrics, logs (using Graylog), job history and
15+
extractors maturity. Extractors can be grouped using labels. User can filter list of extractors by labels, space, trigger
16+
and metadata key.
17+
- Users have more refined options to set extractors triggers at the space level. They can now follow global settings,
18+
disable and enable triggers.
19+
- Ability to set chunksize when downloading files. Set defult to 1MB from 8KB. This will result in faster downloads and
20+
less CPU usage at the cost of slightly more memory use.
21+
- Support for parsing of Date and Numeric data in new metadata fields. New search operators <, >, <=, >= have been
22+
added to search API now that they can be compared properly.
23+
- Track user_id with every extraction event. [#94](https://github.com/clowder-framework/clowder/issues/94)
24+
- Added a new storage report at `GET api/reports/storage/spaces/:id` for auditing user storage usage on a space basis.
25+
- The file and dataset metrics reports also have support for since and until ISO8601 date parameters.
26+
- Added `viewer_hop` a 3D models previewer for `*.ply` and `*.nxz` files. Added `mimetype.nxz=model/nxz` and
27+
`mimetype.NXZ=model/nxz` as new mimetypes in `conf/mimetypes.conf`
28+
29+
### Fixed
30+
- Ignore the `update` field when posting to `/api/extractors`. [#89](https://github.com/clowder-framework/clowder/issues/89)
31+
- Search results were hardcoded to be in batches of 2.
32+
- Fixed permissions checks on search results for search interfaces that would cause misleading counts. [#60](https://github.com/clowder-framework/clowder/issues/60)
33+
734
## 1.11.2 - 2020-10-13
835

936
### Fixed
10-
- Clowder healthcheck was not correct, resulting in docker-compose never thinking it was healthy. This could also result in traefik not setting up the routes.
37+
- Clowder healthcheck was not correct, resulting in docker-compose never thinking it was healthy. This could also result
38+
in traefik not setting up the routes.
1139

1240
## 1.11.1 - 2020-09-29
1341

@@ -40,6 +68,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4068
- Typesafe now only offers https access. [#49](https://github.com/clowder-framework/clowder/issues/49)
4169
- If uploading files by url > 2147483647 it would fail. [#54](https://github.com/clowder-framework/clowder/issues/54)
4270

71+
4372
## 1.10.1 - 2020-07-16
4473

4574
### Fixed

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Following is a list of contributors in alphabetical order:
88
- Brock Angelo
99
- Chen Wang
1010
- Chris Navarro
11+
- Chrysovalantis Constantinou
1112
- Constantinos Sophocleous
1213
- Gene Roeder
1314
- Gregory Jansen
@@ -21,6 +22,7 @@ Following is a list of contributors in alphabetical order:
2122
- Max Burnette
2223
- Michal Ondrejcek
2324
- Michelle Pitcel
25+
- Mike Bobak
2426
- Mike Lambert
2527
- Nicholas Tenczar
2628
- Nishant Nayudu

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use this file to setup Let's Encrypt, or tell clowder to use different security
5656
## Initializing Clowder
5757

5858
Once clowder has started you will need to create an account. This account can be created using a docker
59-
container. You can start it with `docker run -ti --rm --network clowder-clowder clowder/mongo-init`. The
59+
container. You can start it with `docker run -ti --rm --network clowder_clowder clowder/mongo-init`. The
6060
container will ask for an email address, name, password as well as if this user should be admin (true).
6161
Once the container finishes running, you can login to clowder.
6262

app/api/Datasets.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class Datasets @Inject()(
5555
appConfig: AppConfigurationService,
5656
esqueue: ElasticsearchQueue) extends ApiController {
5757

58+
lazy val chunksize = play.Play.application().configuration().getInt("clowder.chunksize", 1024*1024)
59+
5860
def get(id: UUID) = PermissionAction(Permission.ViewDataset, Some(ResourceRef(ResourceRef.dataset, id))) { implicit request =>
5961
datasets.get(id) match {
6062
case Some(d) => Ok(toJson(d))
@@ -1833,7 +1835,7 @@ class Datasets @Inject()(
18331835
case true => {
18341836
current.plugin[RDFExportService].get.getRDFUserMetadataDataset(id.toString, mappingNumber) match{
18351837
case Some(resultFile) =>{
1836-
Ok.chunked(Enumerator.fromStream(new FileInputStream(resultFile)))
1838+
Ok.chunked(Enumerator.fromStream(new FileInputStream(resultFile), chunksize))
18371839
.withHeaders(CONTENT_TYPE -> "application/rdf+xml")
18381840
.withHeaders(CONTENT_DISPOSITION -> (FileUtils.encodeAttachment(resultFile.getName(),request.headers.get("user-agent").getOrElse(""))))
18391841
}
@@ -2749,7 +2751,7 @@ class Datasets @Inject()(
27492751
// Setup userList, add all users of all spaces associated with the dataset
27502752
dataset.spaces.foreach { spaceId =>
27512753
spaces.get(spaceId) match {
2752-
case Some(spc) => userList = spaces.getUsersInSpace(spaceId) ::: userList
2754+
case Some(spc) => userList = spaces.getUsersInSpace(spaceId, None) ::: userList
27532755
case None => NotFound(s"Error: No $spaceTitle found for $id.")
27542756
}
27552757
}

app/api/Extractions.scala

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package api
33
import java.io.{FileInputStream, InputStream}
44
import java.net.URL
55
import java.util.Calendar
6-
import javax.inject.Inject
76

7+
import javax.inject.Inject
88
import controllers.Utils
99
import fileutils.FilesUtils
1010
import models._
@@ -475,7 +475,32 @@ class Extractions @Inject()(
475475
},
476476
info => {
477477
extractors.updateExtractorInfo(info) match {
478-
case Some(u) => Ok(Json.obj("status" -> "OK", "message" -> ("Extractor info updated. ID = " + u.id)))
478+
case Some(u) => {
479+
// Create/assign any default labels for this extractor
480+
u.defaultLabels.foreach(labelStr => {
481+
val segments = labelStr.split("/")
482+
val (labelName, labelCategory) = if (segments.length > 1) {
483+
(segments(1), segments(0))
484+
} else {
485+
(segments(0), "Other")
486+
}
487+
extractors.getExtractorsLabel(labelName) match {
488+
case None => {
489+
// Label does not exist - create and assign it
490+
val createdLabel = extractors.createExtractorsLabel(labelName, Some(labelCategory), List[String](u.name))
491+
}
492+
case Some(lbl) => {
493+
// Label already exists, assign it
494+
if (!lbl.extractors.contains(u.name)) {
495+
val label = ExtractorsLabel(lbl.id, lbl.name, lbl.category, lbl.extractors ++ List[String](u.name))
496+
val updatedLabel = extractors.updateExtractorsLabel(label)
497+
}
498+
}
499+
}
500+
})
501+
502+
Ok(Json.obj("status" -> "OK", "message" -> ("Extractor info updated. ID = " + u.id)))
503+
}
479504
case None => BadRequest(Json.obj("status" -> "KO", "message" -> "Error updating extractor info"))
480505
}
481506
}
@@ -674,4 +699,71 @@ class Extractions @Inject()(
674699
Ok(toJson("added new event"))
675700
}
676701

702+
def createExtractorsLabel() = ServerAdminAction(parse.json) { implicit request =>
703+
// Fetch parameters from request body
704+
val (name, category, assignedExtractors) = parseExtractorsLabel(request)
705+
706+
// Validate that name is not empty
707+
if (name.isEmpty) {
708+
BadRequest("Label Name cannot be empty")
709+
} else {
710+
// Validate that name is unique
711+
extractors.getExtractorsLabel(name) match {
712+
case Some(lbl) => Conflict("Label name is already in use: " + lbl.name)
713+
case None => {
714+
// Create the new label
715+
val label = extractors.createExtractorsLabel(name, category, assignedExtractors)
716+
Ok(Json.toJson(label))
717+
}
718+
}
719+
}
720+
}
721+
722+
def updateExtractorsLabel(id: UUID) = ServerAdminAction(parse.json) { implicit request =>
723+
// Fetch parameters from request body
724+
val (name, category, assignedExtractors) = parseExtractorsLabel(request)
725+
726+
// Validate that name is not empty
727+
if (name.isEmpty) {
728+
BadRequest("Label Name cannot be empty")
729+
} else {
730+
// Validate that name is still unique
731+
extractors.getExtractorsLabel(name) match {
732+
case Some(lbl) => {
733+
// Exclude current id (in case name hasn't changed)
734+
if (lbl.id != id) {
735+
Conflict("Label name is already in use: " + lbl.name)
736+
} else {
737+
// Update the label
738+
val updatedLabel = extractors.updateExtractorsLabel(ExtractorsLabel(id, name, category, assignedExtractors))
739+
Ok(Json.toJson(updatedLabel))
740+
}
741+
}
742+
case None => {
743+
// Update the label
744+
val updatedLabel = extractors.updateExtractorsLabel(ExtractorsLabel(id, name, category, assignedExtractors))
745+
Ok(Json.toJson(updatedLabel))
746+
}
747+
}
748+
}
749+
}
750+
751+
def deleteExtractorsLabel(id: UUID) = ServerAdminAction { implicit request =>
752+
// Fetch existing label
753+
extractors.getExtractorsLabel(id) match {
754+
case Some(lbl) => {
755+
val deleted = extractors.deleteExtractorsLabel(lbl)
756+
Ok(Json.toJson(deleted))
757+
}
758+
case None => BadRequest("Failed to delete label: " + id)
759+
}
760+
}
761+
762+
def parseExtractorsLabel(request: UserRequest[JsValue]): (String, Option[String], List[String]) = {
763+
val name = (request.body \ "name").as[String]
764+
val category = (request.body \ "category").asOpt[String]
765+
val assignedExtractors = (request.body \ "extractors").as[List[String]]
766+
767+
(name, category, assignedExtractors)
768+
}
677769
}

0 commit comments

Comments
 (0)