Skip to content

Commit d51e116

Browse files
authored
Merge pull request #87 from clowder-framework/release/1.11.1
Release/1.11.1
2 parents 6ef6f15 + 9f20fc3 commit d51e116

File tree

14 files changed

+144
-42
lines changed

14 files changed

+144
-42
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ 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.11.1 - 2020-09-29
8+
9+
### Added
10+
- Added healtz endpoint that is cheap and quick to return, useful for kubernetes live/ready checks.
11+
12+
### Fixed
13+
- Fixed health check script when using custom path prefix.
14+
- Proxy will no correctly handle paths that end with a / at the end.
15+
- Submitting an extraction will always return a 500 error, see [#84](https://github.com/clowder-framework/clowder/issues/84)
16+
- Added MongoDB index for `folders.files`.
17+
18+
### Changed
19+
- Updated update-clowder script to work with migration to github. Has the ability now to push a message to MSTEAMS as well as influxdb.
20+
721
## 1.11.0 - 2020-08-31
822

923
### Added

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Following is a list of contributors in alphabetical order:
22

3+
- Aaraj Habib
34
- Ashwini Vaidya
45
- Avinash Kumar
56
- Ben Galewsky

app/api/Extractions.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,22 +530,24 @@ class Extractions @Inject()(
530530
datasetId = datasetslists.head.id
531531
}
532532
// if extractor_id is not specified default to execution of all extractors matching mime type
533-
val key = (request.body \ "extractor").asOpt[String] match {
533+
(request.body \ "extractor").asOpt[String] match {
534534
case Some(extractorId) =>
535535
val job_id = p.submitFileManually(new UUID(originalId), file, Utils.baseUrl(request), extractorId, extra,
536536
datasetId, newFlags, request.apiKey, request.user)
537537
Ok(Json.obj("status" -> "OK", "job_id" -> job_id))
538-
case None =>
538+
case None => {
539539
p.fileCreated(file, None, Utils.baseUrl(request), request.apiKey) match {
540540
case Some(job_id) => {
541541
Ok(Json.obj("status" -> "OK", "job_id" -> job_id))
542542
}
543+
case None => {
544+
val message = "No jobId found for Extraction on fileid=" + file_id.stringify
545+
Logger.error(message)
546+
InternalServerError(toJson(Map("status" -> "KO", "msg" -> message)))
547+
}
543548
}
549+
}
544550
}
545-
546-
val message = "No jobId found for Extraction on fileid=" + file_id.stringify
547-
Logger.error(message)
548-
InternalServerError(toJson(Map("status" -> "KO", "msg" -> message)))
549551
} else {
550552
Conflict(toJson(Map("status" -> "error", "msg" -> "File is not ready. Please wait and try again.")))
551553
}

app/controllers/Application.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class Application @Inject() (files: FileService, collections: CollectionService,
3131
* @param path the path minus the slash
3232
* @return moved permanently to path without /
3333
*/
34-
def untrail(path: String) = Action {
35-
MovedPermanently("/" + path)
34+
def untrail(path: String) = Action { implicit request =>
35+
MovedPermanently(s"${Utils.baseUrl(request, false)}/${path}")
3636
}
3737

3838
def swaggerUI = Action { implicit request =>
@@ -263,6 +263,10 @@ class Application @Inject() (files: FileService, collections: CollectionService,
263263
Ok("")
264264
}
265265

266+
def healthz() = Action { implicit request =>
267+
Ok("healthy")
268+
}
269+
266270
/**
267271
* Bookmarklet
268272
*/

app/controllers/Utils.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ object Utils {
1414
* Return base url given a request. This will add http or https to the front, for example
1515
* https://localhost:9443 will be returned if it is using https.
1616
*/
17-
def baseUrl(request: Request[Any]) = {
18-
routes.Files.list().absoluteURL(https(request))(request).replace("/files", "")
17+
def baseUrl(request: Request[Any], absolute: Boolean = true) = {
18+
if (absolute) {
19+
routes.Files.list().absoluteURL(https(request))(request).replace("/files", "")
20+
} else {
21+
routes.Files.list().url.replace("/files", "")
22+
}
1923
}
2024

2125
/**

app/services/mongodb/MongoSalatPlugin.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class MongoSalatPlugin(app: Application) extends Plugin {
141141
collection("extractions").ensureIndex(MongoDBObject("file_id" -> 1))
142142

143143
collection("folders").ensureIndex(MongoDBObject("parentDatasetId" -> 1))
144+
collection("folders").ensureIndex(MongoDBObject("files" -> 1))
144145

145146
collection("uploads").ensureIndex(MongoDBObject("uploadDate" -> -1))
146147
collection("uploads").ensureIndex(MongoDBObject("author.email" -> 1))

conf/routes

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
#OPTIONS /*path @controllers.Application.options(path)
99
OPTIONS /*path api.ApiHelp.options(path)
10+
11+
# operations are applied in this order, to prevent untrail from removing
12+
# the trailing / at the end of the /api/proxy calls it is placed before
13+
# the untrail call
14+
GET /api/proxy/:endpoint_key @api.Proxy.get(endpoint_key: String, pathSuffix: String = null)
15+
GET /api/proxy/:endpoint_key/ @api.Proxy.get(endpoint_key: String, pathSuffix: String = "")
16+
GET /api/proxy/:endpoint_key/*pathSuffix @api.Proxy.get(endpoint_key: String, pathSuffix: String)
1017
GET /*path/ @controllers.Application.untrail(path: String)
1118

1219
# ----------------------------------------------------------------------
@@ -17,6 +24,7 @@ GET /
1724
GET /about @controllers.Application.about
1825
GET /tos @controllers.Application.tos(redirect: Option[String] ?= None)
1926
GET /email @controllers.Application.email(subject: String ?= "", body: String ?= "")
27+
GET /healthz @controllers.Application.healthz()
2028

2129
# ----------------------------------------------------------------------
2230
# Map static resources from the /public folder to the /assets URL path
@@ -859,17 +867,14 @@ DELETE /api/standardvocab/:id
859867
# PROXY API
860868
# ----------------------------------------------------------------------
861869

862-
GET /api/proxy/:endpoint_key @api.Proxy.get(endpoint_key: String, pathSuffix: String = null)
863-
GET /api/proxy/:endpoint_key/ @api.Proxy.get(endpoint_key: String, pathSuffix: String = null)
864-
GET /api/proxy/:endpoint_key/*pathSuffix @api.Proxy.get(endpoint_key: String, pathSuffix: String)
865870
POST /api/proxy/:endpoint_key @api.Proxy.post(endpoint_key: String, pathSuffix: String = null)
866-
POST /api/proxy/:endpoint_key/ @api.Proxy.post(endpoint_key: String, pathSuffix: String = null)
871+
POST /api/proxy/:endpoint_key/ @api.Proxy.post(endpoint_key: String, pathSuffix: String = "")
867872
POST /api/proxy/:endpoint_key/*pathSuffix @api.Proxy.post(endpoint_key: String, pathSuffix: String)
868873
PUT /api/proxy/:endpoint_key @api.Proxy.put(endpoint_key: String, pathSuffix: String = null)
869-
PUT /api/proxy/:endpoint_key/ @api.Proxy.put(endpoint_key: String, pathSuffix: String = null)
874+
PUT /api/proxy/:endpoint_key/ @api.Proxy.put(endpoint_key: String, pathSuffix: String = "")
870875
PUT /api/proxy/:endpoint_key/*pathSuffix @api.Proxy.put(endpoint_key: String, pathSuffix: String)
871876
DELETE /api/proxy/:endpoint_key @api.Proxy.delete(endpoint_key: String, pathSuffix: String = null)
872-
DELETE /api/proxy/:endpoint_key/ @api.Proxy.delete(endpoint_key: String, pathSuffix: String = null)
877+
DELETE /api/proxy/:endpoint_key/ @api.Proxy.delete(endpoint_key: String, pathSuffix: String = "")
873878
DELETE /api/proxy/:endpoint_key/*pathSuffix @api.Proxy.delete(endpoint_key: String, pathSuffix: String)
874879

875880
# ----------------------------------------------------------------------

doc/src/sphinx/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Luigi Marini'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '1.11.0'
25+
release = '1.11.1'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docker/healthcheck.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22

3-
curl -s --fail http://localhost:9000/api/status || exit 1
3+
### Add trailing backslash if not in context
4+
[[ "${CLOWDER_CONTEXT}" != */ ]] && CLOWDER_CONTEXT="${CLOWDER_CONTEXT}/"
5+
6+
curl -s --fail http://localhost:8000${CLOWDER_CONTEXT:-/}api/status || exit 1

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import NativePackagerKeys._
1313
object ApplicationBuild extends Build {
1414

1515
val appName = "clowder"
16-
val version = "1.11.0"
16+
val version = "1.11.1"
1717
val jvm = "1.7"
1818

1919
def appVersion: String = {

0 commit comments

Comments
 (0)