Skip to content

Commit 85f4b3d

Browse files
authored
Merge pull request #270 from psarando/tapis-v3
CORE-1889 Tapis v3 Migration
2 parents d5549fc + a080498 commit 85f4b3d

File tree

20 files changed

+288
-299
lines changed

20 files changed

+288
-299
lines changed

project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
[medley "1.4.0"]
2323
[metosin/compojure-api "1.1.14"]
2424
[org.cyverse/async-tasks-client "0.0.5"]
25-
[org.cyverse/authy "2.8.0"]
25+
[org.cyverse/authy "3.0.1"]
2626
[org.cyverse/clojure-commons "3.0.10"]
2727
[org.cyverse/debug-utils "2.9.0"]
2828
[org.cyverse/kameleon "3.0.10"]
29-
[org.cyverse/mescal "3.1.12"]
29+
[org.cyverse/mescal "4.0.0"]
3030
[org.cyverse/metadata-client "3.1.2"]
3131
[org.cyverse/common-cli "2.8.2"]
3232
[org.cyverse/common-cfg "2.8.3"]
33-
[org.cyverse/common-swagger-api "3.4.7"]
33+
[org.cyverse/common-swagger-api "3.4.8"]
3434
[org.cyverse/cyverse-groups-client "0.1.9"]
3535
[org.cyverse/permissions-client "2.8.4"]
3636
[org.cyverse/service-logging "2.8.4"]

src/apps/constants.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns apps.constants
2-
(:require [mescal.agave-de-v2.constants :as c]))
2+
(:require [mescal.tapis-de-v3.constants :as c]))
33

44
(def de-system-id "de")
55
(def hpc-system-id c/hpc-system-id)

src/apps/persistence/app_groups.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
(defn get-app-group-hierarchy
99
"Gets the app group hierarchy rooted at the node with the given identifier."
10-
[root-id {:keys [agave-enabled app-ids] :or {agave-enabled "false"}}]
10+
[root-id {:keys [tapis-enabled app-ids] :or {tapis-enabled "false"}}]
1111
(if (seq app-ids)
12-
(select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean agave-enabled) (sql-array "uuid" app-ids)))
13-
(select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean agave-enabled)))))
12+
(select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean tapis-enabled) (sql-array "uuid" app-ids)))
13+
(select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean tapis-enabled)))))
1414

1515
(defn get-visible-workspaces
1616
"Gets the list of workspaces that are visible to the user with the given workspace

src/apps/persistence/app_listing.clj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
(where query {:id [not-in omitted-app-ids]})
8686
query))
8787

88-
(defn- add-agave-pipeline-where-clause
89-
[query {agave-enabled? :agave-enabled :or {agave-enaled? "false"}}]
90-
(let [agave-enabled? (Boolean/parseBoolean agave-enabled?)]
91-
(if-not agave-enabled?
88+
(defn- add-tapis-pipeline-where-clause
89+
[query {tapis-enabled? :tapis-enabled :or {tapis-enabled? "false"}}]
90+
(let [tapis-enabled? (Boolean/parseBoolean tapis-enabled?)]
91+
(if-not tapis-enabled?
9292
(where query {:step_count :task_count})
9393
query)))
9494

@@ -151,7 +151,7 @@
151151
(add-app-id-where-clause query-opts)
152152
(add-app-type-where-clause query-opts)
153153
(add-omitted-app-id-where-clause query-opts)
154-
(add-agave-pipeline-where-clause query-opts)))
154+
(add-tapis-pipeline-where-clause query-opts)))
155155

156156
(defn- get-app-count-base-query
157157
"Adds a where clause to the get-all-apps-count-base-query, filtering out `deleted` apps."
@@ -275,7 +275,7 @@
275275
(add-app-id-where-clause query_opts)
276276
(add-app-type-where-clause query_opts)
277277
(add-omitted-app-id-where-clause query_opts)
278-
(add-agave-pipeline-where-clause query_opts)))
278+
(add-tapis-pipeline-where-clause query_opts)))
279279

280280
(defn- get-app-listing-base-query
281281
"Adds a where clause to the get-all-apps-listing-base-query, filtering out `deleted` apps."
@@ -453,7 +453,7 @@
453453
(add-app-id-where-clause params)
454454
(add-app-type-where-clause params)
455455
(add-omitted-app-id-where-clause params)
456-
(add-agave-pipeline-where-clause params)
456+
(add-tapis-pipeline-where-clause params)
457457
(select))))
458458

459459
(defn list-public-apps-by-user

src/apps/persistence/app_search.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
(where {:es.app_version_id :v.id
3636
:es.task_id nil})))
3737

38-
(defn- add-agave-pipeline-where-clause
39-
[q {agave-enabled? :agave-enabled :or {agave-enaled? "false"}}]
40-
(let [agave-enabled? (Boolean/parseBoolean agave-enabled?)]
41-
(if-not agave-enabled?
38+
(defn- add-tapis-pipeline-where-clause
39+
[q {tapis-enabled? :tapis-enabled :or {tapis-enabled? "false"}}]
40+
(let [tapis-enabled? (Boolean/parseBoolean tapis-enabled?)]
41+
(if-not tapis-enabled?
4242
(where q (not (exists (external-step-subselect))))
4343
q)))
4444

@@ -88,7 +88,7 @@
8888
(add-app-id-where-clause q query-opts)
8989
(add-app-type-where-clause q query-opts)
9090
(add-omitted-app-id-where-clause q query-opts)
91-
(add-agave-pipeline-where-clause q query-opts)
91+
(add-tapis-pipeline-where-clause q query-opts)
9292
(add-search-term-where-clauses q search-term (:pre-matched-app-ids query-opts))
9393
(add-non-admin-where-clauses q query-opts)))
9494

src/apps/persistence/jobs.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424

2525
(def de-job-type "DE")
2626
(def agave-job-type "Agave")
27+
(def tapis-job-type "Tapis")
2728
(def interactive-job-type "Interactive")
2829
(def osg-job-type "OSG")
2930

3031
(def de-client-name c/de-system-id)
31-
(def agave-client-name c/hpc-system-id)
32+
(def tapis-client-name c/hpc-system-id)
3233
(def interactive-client-name c/interactive-system-id)
3334
(def osg-client-name c/osg-system-id)
3435
(def combined-client-name "combined")

src/apps/persistence/oauth.clj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
(:import [java.sql Timestamp]
88
[java.util UUID]))
99

10-
(defn- validate-token-type
11-
"Verifies that the token type is supported."
12-
[token-type]
13-
(when-not (= "bearer" token-type)
14-
(throw+ {:type :clojure-commons.exception/illegal-argument
15-
:error (str "OAuth 2.0 token type, " token-type ", is not supported.")})))
16-
1710
(defn- user-id-subselect
1811
"Returns a subselect statement to find a user ID."
1912
[username]
@@ -73,8 +66,7 @@
7366

7467
(defn store-access-token
7568
"Stores information about an OAuth access token in the database."
76-
[api-name username {:keys [token-type expires-at refresh-token access-token]}]
77-
(validate-token-type token-type)
69+
[api-name username {:keys [expires-at refresh-token access-token]}]
7870
(if (has-access-token api-name username)
7971
(replace-access-token api-name username expires-at refresh-token access-token)
8072
(insert-access-token api-name username expires-at refresh-token access-token)))

src/apps/routes/callbacks.clj

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
(:use [apps.routes.schemas.callback]
33
[common-swagger-api.schema]
44
[common-swagger-api.schema.analyses :only [AnalysisIdPathParam]]
5-
[common-swagger-api.schema.callbacks :only [AgaveJobStatusUpdateParams AgaveJobStatusUpdate]]
5+
[common-swagger-api.schema.callbacks :only [TapisJobStatusUpdate]]
66
[ring.util.http-response :only [ok]])
77
(:require [apps.service.callbacks :as callbacks]))
88

99
(defroutes callbacks
10-
(POST "/de-job" []
11-
:body [body (describe DeJobStatusUpdate "The updated job status information.")]
12-
:summary "Update the status of of a DE analysis."
13-
:description "The jex-events service calls this endpoint when the status of a DE analysis
14-
changes"
15-
(ok (callbacks/update-de-job-status body)))
10+
(POST "/de-job" []
11+
:body [body (describe DeJobStatusUpdate "The updated job status information.")]
12+
:summary "Update the status of of a DE analysis."
13+
:description "The jex-events service calls this endpoint when the status of a DE analysis changes"
14+
(ok (callbacks/update-de-job-status body)))
1615

17-
(POST "/agave-job/:job-id" []
18-
:path-params [job-id :- AnalysisIdPathParam]
19-
:body [body (describe AgaveJobStatusUpdate "The updated job status information.")]
20-
:query [params AgaveJobStatusUpdateParams]
21-
:summary "Update the status of an Agave analysis."
22-
:description "The DE registers this endpoint as a callback when it submts jobs to Agave."
23-
(ok (callbacks/update-agave-job-status job-id (:lastUpdated body) params))))
16+
(POST "/tapis-job/:job-id" []
17+
:path-params [job-id :- AnalysisIdPathParam]
18+
:body [body (describe TapisJobStatusUpdate "The updated job status information.")]
19+
:summary "Update the status of an Tapis analysis."
20+
:description "The DE registers this endpoint as a callback when it submts jobs to Tapis."
21+
(ok (callbacks/update-tapis-job-status job-id body))))

src/apps/service/apps/combined.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
jp/combined-client-name)
2424

2525
(getJobTypes [_]
26-
(mapcat #(.getJobTypes %) clients))
26+
(conj (mapcat #(.getJobTypes %) clients) jp/agave-job-type))
2727

2828
(listSystemIds [_]
2929
(mapcat #(.listSystemIds %) clients))
@@ -368,4 +368,5 @@
368368
(.hasAppPermission (util/get-apps-client clients system-id) username system-id app-id required-level))
369369

370370
(supportsJobSharing [_ job-step]
371-
(.supportsJobSharing (util/apps-client-for-job-step clients job-step) job-step)))
371+
(and (not= (:job_type job-step) jp/agave-job-type)
372+
(.supportsJobSharing (util/apps-client-for-job-step clients job-step) job-step))))

src/apps/service/apps/combined/jobs.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
[{app-version-id :app_version_id} {app-step-number :app_step_number}]
8686
(nth (ap/load-app-steps app-version-id) (dec app-step-number)))
8787

88-
(defn- prepare-agave-job-step-submission
88+
(defn- prepare-tapis-job-step-submission
8989
[job-info job-step submission]
9090
(let [app-step (get-current-app-step job-info job-step)
9191
submission (prepare-common-job-step-submission job-info job-step submission)]
@@ -97,7 +97,7 @@
9797
[job-info job-step submission]
9898
(if (cu/is-de-job-step? job-step)
9999
(prepare-de-job-step-submission job-info job-step submission)
100-
(prepare-agave-job-step-submission job-info job-step submission)))
100+
(prepare-tapis-job-step-submission job-info job-step submission)))
101101

102102
(defn- record-step-submission
103103
[job-id step-number external-id]

0 commit comments

Comments
 (0)