diff --git a/project.clj b/project.clj index 4e221b1d..bf8f1da8 100644 --- a/project.clj +++ b/project.clj @@ -22,15 +22,15 @@ [medley "1.4.0"] [metosin/compojure-api "1.1.14"] [org.cyverse/async-tasks-client "0.0.5"] - [org.cyverse/authy "2.8.0"] + [org.cyverse/authy "3.0.1"] [org.cyverse/clojure-commons "3.0.10"] [org.cyverse/debug-utils "2.9.0"] [org.cyverse/kameleon "3.0.10"] - [org.cyverse/mescal "3.1.12"] + [org.cyverse/mescal "4.0.0"] [org.cyverse/metadata-client "3.1.2"] [org.cyverse/common-cli "2.8.2"] [org.cyverse/common-cfg "2.8.3"] - [org.cyverse/common-swagger-api "3.4.7"] + [org.cyverse/common-swagger-api "3.4.8"] [org.cyverse/cyverse-groups-client "0.1.9"] [org.cyverse/permissions-client "2.8.4"] [org.cyverse/service-logging "2.8.4"] diff --git a/src/apps/constants.clj b/src/apps/constants.clj index 7b1df995..edde468f 100644 --- a/src/apps/constants.clj +++ b/src/apps/constants.clj @@ -1,5 +1,5 @@ (ns apps.constants - (:require [mescal.agave-de-v2.constants :as c])) + (:require [mescal.tapis-de-v3.constants :as c])) (def de-system-id "de") (def hpc-system-id c/hpc-system-id) diff --git a/src/apps/persistence/app_groups.clj b/src/apps/persistence/app_groups.clj index 0f63fa08..91dbfa30 100644 --- a/src/apps/persistence/app_groups.clj +++ b/src/apps/persistence/app_groups.clj @@ -7,10 +7,10 @@ (defn get-app-group-hierarchy "Gets the app group hierarchy rooted at the node with the given identifier." - [root-id {:keys [agave-enabled app-ids] :or {agave-enabled "false"}}] + [root-id {:keys [tapis-enabled app-ids] :or {tapis-enabled "false"}}] (if (seq app-ids) - (select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean agave-enabled) (sql-array "uuid" app-ids))) - (select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean agave-enabled))))) + (select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean tapis-enabled) (sql-array "uuid" app-ids))) + (select (sqlfn :app_category_hierarchy root-id (Boolean/parseBoolean tapis-enabled))))) (defn get-visible-workspaces "Gets the list of workspaces that are visible to the user with the given workspace diff --git a/src/apps/persistence/app_listing.clj b/src/apps/persistence/app_listing.clj index 87cbc475..ddfaa28d 100644 --- a/src/apps/persistence/app_listing.clj +++ b/src/apps/persistence/app_listing.clj @@ -85,10 +85,10 @@ (where query {:id [not-in omitted-app-ids]}) query)) -(defn- add-agave-pipeline-where-clause - [query {agave-enabled? :agave-enabled :or {agave-enaled? "false"}}] - (let [agave-enabled? (Boolean/parseBoolean agave-enabled?)] - (if-not agave-enabled? +(defn- add-tapis-pipeline-where-clause + [query {tapis-enabled? :tapis-enabled :or {tapis-enabled? "false"}}] + (let [tapis-enabled? (Boolean/parseBoolean tapis-enabled?)] + (if-not tapis-enabled? (where query {:step_count :task_count}) query))) @@ -151,7 +151,7 @@ (add-app-id-where-clause query-opts) (add-app-type-where-clause query-opts) (add-omitted-app-id-where-clause query-opts) - (add-agave-pipeline-where-clause query-opts))) + (add-tapis-pipeline-where-clause query-opts))) (defn- get-app-count-base-query "Adds a where clause to the get-all-apps-count-base-query, filtering out `deleted` apps." @@ -275,7 +275,7 @@ (add-app-id-where-clause query_opts) (add-app-type-where-clause query_opts) (add-omitted-app-id-where-clause query_opts) - (add-agave-pipeline-where-clause query_opts))) + (add-tapis-pipeline-where-clause query_opts))) (defn- get-app-listing-base-query "Adds a where clause to the get-all-apps-listing-base-query, filtering out `deleted` apps." @@ -453,7 +453,7 @@ (add-app-id-where-clause params) (add-app-type-where-clause params) (add-omitted-app-id-where-clause params) - (add-agave-pipeline-where-clause params) + (add-tapis-pipeline-where-clause params) (select)))) (defn list-public-apps-by-user diff --git a/src/apps/persistence/app_search.clj b/src/apps/persistence/app_search.clj index 6e84bc4d..fbf0683f 100644 --- a/src/apps/persistence/app_search.clj +++ b/src/apps/persistence/app_search.clj @@ -35,10 +35,10 @@ (where {:es.app_version_id :v.id :es.task_id nil}))) -(defn- add-agave-pipeline-where-clause - [q {agave-enabled? :agave-enabled :or {agave-enaled? "false"}}] - (let [agave-enabled? (Boolean/parseBoolean agave-enabled?)] - (if-not agave-enabled? +(defn- add-tapis-pipeline-where-clause + [q {tapis-enabled? :tapis-enabled :or {tapis-enabled? "false"}}] + (let [tapis-enabled? (Boolean/parseBoolean tapis-enabled?)] + (if-not tapis-enabled? (where q (not (exists (external-step-subselect)))) q))) @@ -88,7 +88,7 @@ (add-app-id-where-clause q query-opts) (add-app-type-where-clause q query-opts) (add-omitted-app-id-where-clause q query-opts) - (add-agave-pipeline-where-clause q query-opts) + (add-tapis-pipeline-where-clause q query-opts) (add-search-term-where-clauses q search-term (:pre-matched-app-ids query-opts)) (add-non-admin-where-clauses q query-opts))) diff --git a/src/apps/persistence/jobs.clj b/src/apps/persistence/jobs.clj index 1f410134..c250e4c7 100644 --- a/src/apps/persistence/jobs.clj +++ b/src/apps/persistence/jobs.clj @@ -24,11 +24,12 @@ (def de-job-type "DE") (def agave-job-type "Agave") +(def tapis-job-type "Tapis") (def interactive-job-type "Interactive") (def osg-job-type "OSG") (def de-client-name c/de-system-id) -(def agave-client-name c/hpc-system-id) +(def tapis-client-name c/hpc-system-id) (def interactive-client-name c/interactive-system-id) (def osg-client-name c/osg-system-id) (def combined-client-name "combined") diff --git a/src/apps/persistence/oauth.clj b/src/apps/persistence/oauth.clj index 93e6f21f..57f3230a 100644 --- a/src/apps/persistence/oauth.clj +++ b/src/apps/persistence/oauth.clj @@ -7,13 +7,6 @@ (:import [java.sql Timestamp] [java.util UUID])) -(defn- validate-token-type - "Verifies that the token type is supported." - [token-type] - (when-not (= "bearer" token-type) - (throw+ {:type :clojure-commons.exception/illegal-argument - :error (str "OAuth 2.0 token type, " token-type ", is not supported.")}))) - (defn- user-id-subselect "Returns a subselect statement to find a user ID." [username] @@ -73,8 +66,7 @@ (defn store-access-token "Stores information about an OAuth access token in the database." - [api-name username {:keys [token-type expires-at refresh-token access-token]}] - (validate-token-type token-type) + [api-name username {:keys [expires-at refresh-token access-token]}] (if (has-access-token api-name username) (replace-access-token api-name username expires-at refresh-token access-token) (insert-access-token api-name username expires-at refresh-token access-token))) diff --git a/src/apps/routes/callbacks.clj b/src/apps/routes/callbacks.clj index a7d172b0..8dc7f21a 100644 --- a/src/apps/routes/callbacks.clj +++ b/src/apps/routes/callbacks.clj @@ -2,22 +2,20 @@ (:use [apps.routes.schemas.callback] [common-swagger-api.schema] [common-swagger-api.schema.analyses :only [AnalysisIdPathParam]] - [common-swagger-api.schema.callbacks :only [AgaveJobStatusUpdateParams AgaveJobStatusUpdate]] + [common-swagger-api.schema.callbacks :only [TapisJobStatusUpdate]] [ring.util.http-response :only [ok]]) (:require [apps.service.callbacks :as callbacks])) (defroutes callbacks - (POST "/de-job" [] - :body [body (describe DeJobStatusUpdate "The updated job status information.")] - :summary "Update the status of of a DE analysis." - :description "The jex-events service calls this endpoint when the status of a DE analysis - changes" - (ok (callbacks/update-de-job-status body))) + (POST "/de-job" [] + :body [body (describe DeJobStatusUpdate "The updated job status information.")] + :summary "Update the status of of a DE analysis." + :description "The jex-events service calls this endpoint when the status of a DE analysis changes" + (ok (callbacks/update-de-job-status body))) - (POST "/agave-job/:job-id" [] - :path-params [job-id :- AnalysisIdPathParam] - :body [body (describe AgaveJobStatusUpdate "The updated job status information.")] - :query [params AgaveJobStatusUpdateParams] - :summary "Update the status of an Agave analysis." - :description "The DE registers this endpoint as a callback when it submts jobs to Agave." - (ok (callbacks/update-agave-job-status job-id (:lastUpdated body) params)))) + (POST "/tapis-job/:job-id" [] + :path-params [job-id :- AnalysisIdPathParam] + :body [body (describe TapisJobStatusUpdate "The updated job status information.")] + :summary "Update the status of an Tapis analysis." + :description "The DE registers this endpoint as a callback when it submts jobs to Tapis." + (ok (callbacks/update-tapis-job-status job-id body)))) diff --git a/src/apps/service/apps/combined.clj b/src/apps/service/apps/combined.clj index 0cc0593d..c5ef338c 100644 --- a/src/apps/service/apps/combined.clj +++ b/src/apps/service/apps/combined.clj @@ -23,7 +23,7 @@ jp/combined-client-name) (getJobTypes [_] - (mapcat #(.getJobTypes %) clients)) + (conj (mapcat #(.getJobTypes %) clients) jp/agave-job-type)) (listSystemIds [_] (mapcat #(.listSystemIds %) clients)) @@ -368,4 +368,5 @@ (.hasAppPermission (util/get-apps-client clients system-id) username system-id app-id required-level)) (supportsJobSharing [_ job-step] - (.supportsJobSharing (util/apps-client-for-job-step clients job-step) job-step))) + (and (not= (:job_type job-step) jp/agave-job-type) + (.supportsJobSharing (util/apps-client-for-job-step clients job-step) job-step)))) diff --git a/src/apps/service/apps/combined/jobs.clj b/src/apps/service/apps/combined/jobs.clj index a589dbc5..baaaeb5f 100644 --- a/src/apps/service/apps/combined/jobs.clj +++ b/src/apps/service/apps/combined/jobs.clj @@ -85,7 +85,7 @@ [{app-version-id :app_version_id} {app-step-number :app_step_number}] (nth (ap/load-app-steps app-version-id) (dec app-step-number))) -(defn- prepare-agave-job-step-submission +(defn- prepare-tapis-job-step-submission [job-info job-step submission] (let [app-step (get-current-app-step job-info job-step) submission (prepare-common-job-step-submission job-info job-step submission)] @@ -97,7 +97,7 @@ [job-info job-step submission] (if (cu/is-de-job-step? job-step) (prepare-de-job-step-submission job-info job-step submission) - (prepare-agave-job-step-submission job-info job-step submission))) + (prepare-tapis-job-step-submission job-info job-step submission))) (defn- record-step-submission [job-id step-number external-id] diff --git a/src/apps/service/apps/jobs/util.clj b/src/apps/service/apps/jobs/util.clj index 447e309b..50f4e010 100644 --- a/src/apps/service/apps/jobs/util.clj +++ b/src/apps/service/apps/jobs/util.clj @@ -2,6 +2,7 @@ (:use [slingshot.slingshot :only [try+ throw+]]) (:require [apps.clients.data-info :as data-info] [apps.persistence.jobs :as jp] + [apps.persistence.app-metadata :as am] [apps.util.service :as service] [clojure.string :as string] [clojure.tools.logging :as log] @@ -51,8 +52,7 @@ "FolderInput" "collection" "MultiFileSelector" "many"}) -(def input-types - (set (keys input-multiplicities))) +(def input-types am/param-ds-input-types) (def output-multiplicities {"FileOutput" "single" diff --git a/src/apps/service/apps/agave.clj b/src/apps/service/apps/tapis.clj similarity index 84% rename from src/apps/service/apps/agave.clj rename to src/apps/service/apps/tapis.clj index f3673cd0..e8378104 100644 --- a/src/apps/service/apps/agave.clj +++ b/src/apps/service/apps/tapis.clj @@ -1,12 +1,12 @@ -(ns apps.service.apps.agave +(ns apps.service.apps.tapis (:use [kameleon.uuids :only [uuidify]]) (:require [clojure.string :as string] [apps.persistence.jobs :as jp] [apps.protocols] - [apps.service.apps.agave.listings :as listings] - [apps.service.apps.agave.pipelines :as pipelines] - [apps.service.apps.agave.jobs :as agave-jobs] - [apps.service.apps.agave.sharing :as sharing] + [apps.service.apps.tapis.listings :as listings] + [apps.service.apps.tapis.pipelines :as pipelines] + [apps.service.apps.tapis.jobs :as tapis-jobs] + [apps.service.apps.tapis.sharing :as sharing] [apps.service.apps.job-listings :as job-listings] [apps.service.apps.permissions :as app-permissions] [apps.service.apps.util :as apps-util] @@ -48,7 +48,7 @@ [] (service/bad-request app-categorization-rejection)) -(def ^:private supported-system-ids #{jp/agave-client-name}) +(def ^:private supported-system-ids #{jp/tapis-client-name}) (def ^:private validate-system-id (partial apps-util/validate-system-id supported-system-ids)) (def ^:private validate-system-ids (partial apps-util/validate-system-ids supported-system-ids)) @@ -57,17 +57,17 @@ :documentation "" :references []}) -(deftype AgaveApps [agave user-has-access-token? user] +(deftype TapisApps [tapis user-has-access-token? user] apps.protocols.Apps (getUser [_] user) (getClientName [_] - jp/agave-client-name) + jp/tapis-client-name) (getJobTypes [_] - [jp/agave-job-type]) + [jp/tapis-job-type]) (listSystemIds [_] (vec supported-system-ids)) @@ -77,54 +77,54 @@ (listAppCategories [_ {:keys [hpc]}] (when-not (and hpc (.equalsIgnoreCase hpc "false")) - [(.hpcAppGroup agave)])) + [(.hpcAppGroup tapis)])) (listAppsInCategory [self system-id category-id params] (validate-system-id system-id) (if (apps-util/app-type-qualifies? self params) - (listings/list-apps agave category-id params) - (.emptyAppListing agave))) + (listings/list-apps tapis category-id params) + (.emptyAppListing tapis))) (listAppsUnderHierarchy [self root-iri attr params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/list-apps-with-ontology agave root-iri params false) - (.emptyAppListing agave)))) + (listings/list-apps-with-ontology tapis root-iri params false) + (.emptyAppListing tapis)))) (adminListAppsUnderHierarchy [self ontology-version root-iri attr params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/list-apps-with-ontology agave root-iri params true) - (.emptyAppListing agave)))) + (listings/list-apps-with-ontology tapis root-iri params true) + (.emptyAppListing tapis)))) - ;; Since Agave doesn't list apps under ontology hierarchies, we'll use the ontology listing with communities for now. + ;; Since Tapis doesn't list apps under ontology hierarchies, we'll use the ontology listing with communities for now. (listAppsInCommunity [self community-id params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/list-apps-with-ontology agave community-id params false) - (.emptyAppListing agave)))) + (listings/list-apps-with-ontology tapis community-id params false) + (.emptyAppListing tapis)))) (adminListAppsInCommunity [self community-id params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/list-apps-with-ontology agave community-id params true) - (.emptyAppListing agave)))) + (listings/list-apps-with-ontology tapis community-id params true) + (.emptyAppListing tapis)))) (searchApps [self search-term params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/search-apps agave search-term params false) - (.emptyAppListing agave)))) + (listings/search-apps tapis search-term params false) + (.emptyAppListing tapis)))) (listSingleApp [_ system-id app-id] (validate-system-id system-id) - (listings/list-app agave app-id)) + (listings/list-app tapis app-id)) (adminSearchApps [self search-term params] (when (user-has-access-token?) (if (apps-util/app-type-qualifies? self params) - (listings/search-apps agave search-term params true) - (.emptyAppListing agave)))) + (listings/search-apps tapis search-term params true) + (.emptyAppListing tapis)))) (canEditApps [_] false) @@ -154,7 +154,7 @@ (getAppJobView [_ system-id app-id _] (validate-system-id system-id) - (.getApp agave app-id)) + (.getApp tapis app-id)) (getAppVersionJobView [_ system-id _ _] (validate-system-id system-id) @@ -190,7 +190,7 @@ (getAppDetails [_ system-id app-id admin?] (validate-system-id system-id) - (listings/get-app-details agave app-id admin?)) + (listings/get-app-details tapis app-id admin?)) (getAppVersionDetails [_ system-id _ _ _] (validate-system-id system-id) @@ -234,7 +234,7 @@ (getAppTaskListing [_ system-id app-id] (validate-system-id system-id) - (.listAppTasks agave app-id)) + (.listAppTasks tapis app-id)) (getAppVersionTaskListing [_ system-id _ _] (validate-system-id system-id) @@ -242,7 +242,7 @@ (getAppToolListing [_ system-id app-id] (validate-system-id system-id) - (.getAppToolListing agave app-id)) + (.getAppToolListing tapis app-id)) (getAppVersionToolListing [_ system-id _ _] (validate-system-id system-id) @@ -258,10 +258,10 @@ (getAppInputIds [_ system-id app-id _] (validate-system-id system-id) - (.getAppInputIds agave app-id)) + (.getAppInputIds tapis app-id)) (formatPipelineTasks [_ pipeline] - (pipelines/format-pipeline-tasks agave pipeline)) + (pipelines/format-pipeline-tasks tapis pipeline)) (listJobs [self params] (job-listings/list-jobs self user params)) @@ -274,40 +274,40 @@ (loadAppTables [_ qualified-app-ids] (validate-system-ids (set (map :system_id qualified-app-ids))) - (listings/load-app-tables agave (set (map :app_id qualified-app-ids)))) + (listings/load-app-tables tapis (set (map :app_id qualified-app-ids)))) (submitJob [this submission] (validate-system-id (:system_id submission)) - (agave-jobs/submit agave user submission)) + (tapis-jobs/submit tapis user submission)) (submitJobStep [_ job-id submission] - (agave-jobs/submit-step agave job-id submission)) + (tapis-jobs/submit-step tapis job-id submission)) (translateJobStatus [self job-type status] (when (apps-util/supports-job-type? self job-type) - (or (.translateJobStatus agave status) status))) + (or (.translateJobStatus tapis status) status))) (updateJobStatus [self job-step job status end-date] (when (apps-util/supports-job-type? self (:job_type job-step)) - (agave-jobs/update-job-status agave job-step job status end-date))) + (tapis-jobs/update-job-status tapis job-step job status end-date))) (getDefaultOutputName [_ io-map source-step] - (agave-jobs/get-default-output-name agave io-map source-step)) + (tapis-jobs/get-default-output-name tapis io-map source-step)) (getJobStepStatus [_ job-step] - (agave-jobs/get-job-step-status agave job-step)) + (tapis-jobs/get-job-step-status tapis job-step)) (getJobStepHistory [_ {:keys [external_id]}] - (.getJobHistory agave external_id)) + (.getJobHistory tapis external_id)) (getParamDefinitions [_ system-id app-id version-id] (validate-system-id system-id) - (listings/get-param-definitions agave app-id version-id)) + (listings/get-param-definitions tapis app-id version-id)) (stopJobStep [self {:keys [job_type external_id]}] (when (and (apps-util/supports-job-type? self job_type) (not (string/blank? external_id))) - (.stopJob agave external_id))) + (.stopJob tapis external_id))) (categorizeApps [_ {:keys [categories]}] (validate-system-ids (set (map :system_id categories))) @@ -420,7 +420,7 @@ (listAppPermissions [_ qualified-app-ids _] (validate-system-ids (set (map :system_id qualified-app-ids))) - (.listAppPermissions agave (map :app_id qualified-app-ids))) + (.listAppPermissions tapis (map :app_id qualified-app-ids))) (shareApps [self admin? sharing-requests] (app-permissions/process-app-sharing-requests self admin? sharing-requests)) @@ -430,7 +430,7 @@ (shareAppWithSubject [_ _ app-names sharee system-id app-id level] (validate-system-id system-id) - (sharing/share-app-with-subject agave app-names sharee app-id level)) + (sharing/share-app-with-subject tapis app-names sharee app-id level)) (unshareApps [self admin? unsharing-requests] (app-permissions/process-app-unsharing-requests self admin? unsharing-requests)) @@ -440,11 +440,11 @@ (unshareAppWithSubject [_ _ app-names sharee system-id app-id] (validate-system-id system-id) - (sharing/unshare-app-with-subject agave app-names sharee app-id)) + (sharing/unshare-app-with-subject tapis app-names sharee app-id)) (hasAppPermission [_ username system-id app-id required-level] (validate-system-id system-id) - (.hasAppPermission agave username app-id required-level)) + (.hasAppPermission tapis username app-id required-level)) (supportsJobSharing [_ _] true)) diff --git a/src/apps/service/apps/agave/jobs.clj b/src/apps/service/apps/tapis/jobs.clj similarity index 69% rename from src/apps/service/apps/agave/jobs.clj rename to src/apps/service/apps/tapis/jobs.clj index 3d32b51d..dd66ba12 100644 --- a/src/apps/service/apps/agave/jobs.clj +++ b/src/apps/service/apps/tapis/jobs.clj @@ -1,10 +1,9 @@ -(ns apps.service.apps.agave.jobs +(ns apps.service.apps.tapis.jobs (:use [apps.util.conversions :only [remove-nil-vals]] [slingshot.slingshot :only [try+ throw+]] [common-swagger-api.schema :only [NonBlankString]]) (:require [cemerick.url :as curl] [cheshire.core :as cheshire] - [clojure.string :as string] [clojure.tools.logging :as log] [clojure-commons.file-utils :as ft] [kameleon.db :as db] @@ -17,11 +16,10 @@ (defn- build-callback-url [id] - (str (assoc (curl/url (config/agave-callback-base) (str id)) - :query "status=${JOB_STATUS}&external-id=${JOB_ID}&end-time=${JOB_END_TIME}"))) + (str (curl/url (config/tapis-callback-base) (str id)))) (defn- format-submission - [agave job-id result-folder-path {:keys [config] :as submission}] + [_ job-id result-folder-path {:keys [config] :as submission}] (-> submission (dissoc :starting_step :step_number :job_config) (assoc :config (:job_config submission config) @@ -32,12 +30,12 @@ :create_output_subdir false))) (defn- prepare-submission - [agave job-id submission] - (->> (format-submission agave + [tapis job-id submission] + (->> (format-submission tapis job-id (ft/build-result-folder-path submission) submission) - (.prepareJobSubmission agave))) + (.prepareJobSubmission tapis))) (def JobInfo "A schema used to validate job information." @@ -61,7 +59,7 @@ (s/validate JobInfo job-info) (catch Object _ (log/error (:throwable &throw-context) - (str "received an invalid job submission response from Agave:\n" + (str "received an invalid job submission response from Tapis:\n" (cheshire/encode job-info {:pretty true}))) (service/request-failure (str "Unexpected job submission response: " (.getMessage (:throwable &throw-context))))))) @@ -72,9 +70,9 @@ (db/now))) (defn- send-submission* - [agave user submission job] + [tapis user submission job] (try+ - (let [job-info (.sendJobSubmission agave job)] + (let [job-info (.sendJobSubmission tapis job)] (assoc job-info :name (:name submission) :notify (:notify submission false) @@ -84,7 +82,7 @@ (when-not (:parent_id submission) (throw+))))) -(defn- store-agave-job +(defn- store-tapis-job [user job-id job submission] (jp/save-job {:id job-id :job_name (:name job) @@ -109,87 +107,83 @@ :external_id (:id job) :start_date (:startdate job) :status (:status job) - :job_type jp/agave-job-type + :job_type jp/tapis-job-type :app_step_number 1})) (defn- format-job-submission-response [job-id submission job] (remove-nil-vals - {:app_description (:app_description job) - :app_disabled false - :app_id (:app_id job) - :app_name (:app_name job) - :batch false - :description (:description job) - :enddate (:enddate job) - :system_id jp/agave-client-name - :id job-id - :name (:name job) - :notify (:notify job) - :resultfolderid (:resultfolderid job) - :startdate (str (.getTime (:startdate job))) - :status (:status job) - :username (:username job) - :wiki_url (:wiki_url job) - :parent_id (:parent_id submission)})) + {:app_description (:app_description job) + :app_disabled false + :app_id (:app_id job) + :app_name (:app_name job) + :batch false + :description (:description job) + :enddate (:enddate job) + :system_id jp/tapis-client-name + :id job-id + :name (:name job) + :notify (:notify job) + :resultfolderid (:resultfolderid job) + :startdate (str (.getTime (:startdate job))) + :status (:status job) + :username (:username job) + :wiki_url (:wiki_url job) + :parent_id (:parent_id submission)})) (defn- handle-successful-submission [user job-id job submission] - (store-agave-job user job-id job submission) + (store-tapis-job user job-id job submission) (store-job-step job-id job) (format-job-submission-response job-id submission job)) (defn- handle-failed-submission [user job-id job submission] (let [job (assoc job :status jp/failed-status)] - (store-agave-job user job-id job submission) + (store-tapis-job user job-id job submission) (store-job-step job-id job) (format-job-submission-response job-id submission job))) (defn- send-submission - [agave user job-id submission job] - (if-let [submitted-job (send-submission* agave user submission job)] + [tapis user job-id submission job] + (if-let [submitted-job (send-submission* tapis user submission job)] (handle-successful-submission user job-id submitted-job submission) (handle-failed-submission user job-id job submission))) (defn submit - [agave user submission] + [tapis user submission] (let [job-id (or (:job_id submission) (uuids/uuid))] - (->> (prepare-submission agave job-id submission) + (->> (prepare-submission tapis job-id submission) (json-util/log-json "job") - (send-submission agave user job-id submission)))) + (send-submission tapis user job-id submission)))) (defn submit-step - [agave job-id submission] - (->> (prepare-submission agave job-id submission) + [tapis job-id submission] + (->> (prepare-submission tapis job-id submission) (json-util/log-json "job step") - (.sendJobSubmission agave) + (.sendJobSubmission tapis) (:id))) (defn- translate-job-status - [agave status] + [tapis status] (if-not (jp/valid-status? status) - (.translateJobStatus agave status) + (.translateJobStatus tapis status) status)) (defn update-job-status - [agave {:keys [external_id] :as job-step} {job-id :id :as job} status end-date] - (let [status (translate-job-status agave status) + [tapis {:keys [external_id] :as job-step} {job-id :id :as job} status end-date] + (let [status (translate-job-status tapis status) end-date (when (jp/completed? status) end-date)] (when (and status (jp/status-follows? status (:status job-step))) (jp/update-job-step job-id external_id status end-date) (jp/update-job job-id status end-date)))) (defn get-default-output-name - [agave {external-output-id :external_output_id} {external-app-id :external_app_id}] - (.getDefaultOutputName agave external-app-id external-output-id)) + [tapis {external-output-id :external_output_id} {external-app-id :external_app_id}] + (.getDefaultOutputName tapis external-app-id external-output-id)) (defn get-job-step-status - [agave {:keys [external_id]}] + [tapis {:keys [external_id]}] (try+ - (select-keys (.listJob agave external_id) [:status :enddate]) + (select-keys (.listJob tapis external_id) [:status :enddate]) (catch [:status 404] _ nil))) - -(defn prepare-step-submission - [agave job-id submission] - (prepare-submission agave job-id submission)) diff --git a/src/apps/service/apps/agave/listings.clj b/src/apps/service/apps/tapis/listings.clj similarity index 75% rename from src/apps/service/apps/agave/listings.clj rename to src/apps/service/apps/tapis/listings.clj index a10ab364..a91f638b 100644 --- a/src/apps/service/apps/agave/listings.clj +++ b/src/apps/service/apps/tapis/listings.clj @@ -1,4 +1,4 @@ -(ns apps.service.apps.agave.listings +(ns apps.service.apps.tapis.listings (:use [apps.service.apps.util :only [to-qualified-app-id]] [apps.service.util :only [sort-apps apply-offset apply-limit format-job-stats valid-uuid?]] [apps.util.conversions :only [remove-nil-vals]] @@ -10,7 +10,7 @@ [clojure-commons.error-codes :as ce :refer [clj-http-error?]])) ;; TODO: restore the job stats gathering when we have a more efficient way to do this. -(defn- add-agave-job-stats +(defn- add-tapis-job-stats [{:keys [id] :as app} params admin?] (merge app {:job_count_completed 0 :job_count 0 @@ -22,7 +22,7 @@ (defn- add-app-listing-job-stats [app-listing params admin?] (if admin? - (update app-listing :apps (partial map (comp remove-nil-vals #(add-agave-job-stats % params admin?)))) + (update app-listing :apps (partial map (comp remove-nil-vals #(add-tapis-job-stats % params admin?)))) app-listing)) (defn- format-app-listing-job-stats @@ -49,16 +49,16 @@ (add-app-integrator-info subject-info-for app-details))) (defn get-app-details - [agave app-id admin?] - (-> (.getAppDetails agave app-id) + [tapis app-id admin?] + (-> (.getAppDetails tapis app-id) add-app-details-integrator-info - (add-agave-job-stats nil admin?) + (add-tapis-job-stats nil admin?) (format-job-stats admin?) remove-nil-vals)) (defn list-apps - [agave category-id params] - (-> (.listApps agave) + [tapis category-id params] + (-> (.listApps tapis) add-app-integrator-info (add-app-listing-job-stats params false) (sort-apps params {:default-sort-field "name"}) @@ -67,15 +67,15 @@ (format-app-listing-job-stats false))) (defn list-app - [agave app-id] - (-> (.listApps agave [app-id] {}) + [tapis app-id] + (-> (.listApps tapis [app-id] {}) add-app-integrator-info (select-keys [:total :apps]))) (defn list-apps-with-ontology - [agave term params admin?] + [tapis term params admin?] (try+ - (-> (select-keys (.listAppsWithOntology agave term) [:total :apps]) + (-> (select-keys (.listAppsWithOntology tapis term) [:total :apps]) add-app-integrator-info (add-app-listing-job-stats params admin?) (sort-apps params {:default-sort-field "name"}) @@ -83,10 +83,10 @@ (apply-limit params) (format-app-listing-job-stats admin?)) (catch [:error_code ce/ERR_UNAVAILABLE] _ - (log/error (:throwable &throw-context) "Agave app listing timed out") + (log/error (:throwable &throw-context) "Tapis app listing timed out") nil) (catch clj-http-error? _ - (log/error (:throwable &throw-context) "HTTP error returned by Agave") + (log/error (:throwable &throw-context) "HTTP error returned by Tapis") nil))) (defn- fix-search-params @@ -94,9 +94,9 @@ (remove-nil-vals {:app-subset (when admin? (:app-subset params :public))})) (defn search-apps - [agave search-term params admin?] + [tapis search-term params admin?] (try+ - (-> (.searchApps agave search-term (fix-search-params params admin?)) + (-> (.searchApps tapis search-term (fix-search-params params admin?)) add-app-integrator-info (add-app-listing-job-stats params admin?) (sort-apps params {:default-sort-field "name"}) @@ -104,29 +104,29 @@ (apply-limit params) (format-app-listing-job-stats admin?)) (catch [:error_code ce/ERR_UNAVAILABLE] _ - (log/error (:throwable &throw-context) "Agave app search timed out") + (log/error (:throwable &throw-context) "Tapis app search timed out") nil) (catch clj-http-error? _ - (log/error (:throwable &throw-context) "HTTP error returned by Agave") + (log/error (:throwable &throw-context) "HTTP error returned by Tapis") nil))) (defn load-app-tables - [agave app-ids] + [tapis app-ids] (try+ - (->> (.listApps agave app-ids {}) + (->> (.listApps tapis app-ids {}) (:apps) (map (juxt to-qualified-app-id identity)) (into {}) (vector)) (catch [:type :clojure-commons.exception/unavailable] _ - (log/warn (:throwable &throw-context) "Agave app table retrieval timed out") + (log/warn (:throwable &throw-context) "Tapis app table retrieval timed out") []) (catch clj-http-error? _ - (log/error (:throwable &throw-context) "HTTP error returned by Agave") + (log/error (:throwable &throw-context) "HTTP error returned by Tapis") []))) -(defn- prep-agave-param - [step-id agave-app-id param] +(defn- prep-tapis-param + [step-id tapis-app-id param] (let [is-file-param? (re-find #"^(?:File|Folder)" (:type param))] {:data_format (when is-file-param? "Unspecified") :info_type (when is-file-param? "PlainText") @@ -134,7 +134,7 @@ :is_visible (:isVisible param) :name (:name param) :is_implicit false - :external_app_id agave-app-id + :external_app_id tapis-app-id :ordering (:order param) :type (:type param) :step_id step-id @@ -143,28 +143,28 @@ :description (:description param) :default_value (:defaultValue param)})) -(defn- load-agave-pipeline-step-params - [agave-client {step-id :step_id agave-app-id :external_app_id}] - (->> (.getApp agave-client agave-app-id) +(defn- load-tapis-pipeline-step-params + [tapis-client {step-id :step_id tapis-app-id :external_app_id}] + (->> (.getApp tapis-client tapis-app-id) (:groups) (mapcat :parameters) - (map (partial prep-agave-param step-id agave-app-id)))) + (map (partial prep-tapis-param step-id tapis-app-id)))) -(defn- load-agave-pipeline-params - [agave-client app-version-id] +(defn- load-tapis-pipeline-params + [tapis-client app-version-id] (->> (ap/load-app-steps app-version-id) (remove (comp nil? :external_app_id)) - (mapcat (partial load-agave-pipeline-step-params agave-client)))) + (mapcat (partial load-tapis-pipeline-step-params tapis-client)))) -(defn- load-agave-app-params - [agave-client app-id] - (->> (.getApp agave-client app-id) +(defn- load-tapis-app-params + [tapis-client app-id] + (->> (.getApp tapis-client app-id) (:groups) (mapcat :parameters) - (map (partial prep-agave-param nil app-id)))) + (map (partial prep-tapis-param nil app-id)))) (defn get-param-definitions - [agave app-id version-id] + [tapis app-id version-id] (if (and version-id (valid-uuid? app-id)) - (load-agave-pipeline-params agave version-id) - (load-agave-app-params agave app-id))) + (load-tapis-pipeline-params tapis version-id) + (load-tapis-app-params tapis app-id))) diff --git a/src/apps/service/apps/agave/pipelines.clj b/src/apps/service/apps/tapis/pipelines.clj similarity index 53% rename from src/apps/service/apps/agave/pipelines.clj rename to src/apps/service/apps/tapis/pipelines.clj index 4e3a6ef6..843ae1c1 100644 --- a/src/apps/service/apps/agave/pipelines.clj +++ b/src/apps/service/apps/tapis/pipelines.clj @@ -1,19 +1,19 @@ -(ns apps.service.apps.agave.pipelines +(ns apps.service.apps.tapis.pipelines (:require [apps.util.service :as service])) -(defn- get-agave-task - [agave external-app-id] +(defn- get-tapis-task + [tapis external-app-id] ((comp first :tasks) - (service/assert-found (.listAppTasks agave external-app-id) "Agave app" external-app-id))) + (service/assert-found (.listAppTasks tapis external-app-id) "Tapis app" external-app-id))) (defn- format-task - [agave external-app-ids {:keys [id] :as task}] + [tapis external-app-ids {:keys [id] :as task}] (if-let [external-app-id (external-app-ids id)] - (assoc (merge task (select-keys (get-agave-task agave external-app-id) [:inputs :outputs])) + (assoc (merge task (select-keys (get-tapis-task tapis external-app-id) [:inputs :outputs])) :id external-app-id) task)) (defn format-pipeline-tasks - [agave pipeline] + [tapis pipeline] (let [external-app-ids (into {} (map (juxt :task_id :external_app_id) (:steps pipeline)))] - (update-in pipeline [:tasks] (partial map (partial format-task agave external-app-ids))))) + (update-in pipeline [:tasks] (partial map (partial format-task tapis external-app-ids))))) diff --git a/src/apps/service/apps/agave/sharing.clj b/src/apps/service/apps/tapis/sharing.clj similarity index 50% rename from src/apps/service/apps/agave/sharing.clj rename to src/apps/service/apps/tapis/sharing.clj index ce5cb02f..38a2293a 100644 --- a/src/apps/service/apps/agave/sharing.clj +++ b/src/apps/service/apps/tapis/sharing.clj @@ -1,4 +1,4 @@ -(ns apps.service.apps.agave.sharing +(ns apps.service.apps.tapis.sharing (:use [slingshot.slingshot :only [try+]]) (:require [apps.clients.iplant-groups :as ipg] [apps.persistence.jobs :as jp] @@ -7,36 +7,38 @@ [clojure.tools.logging :as log])) (defn- try-share-app-with-subject - [agave sharee app-id level success-fn failure-fn] + [tapis sharee app-id level success-fn failure-fn] (if-not (ipg/user-source? (:source_id sharee)) (failure-fn "Sharing HPC apps with a group is not supported") (try+ - (.shareAppWithUser agave (:id sharee) app-id level) + (if level + (.shareAppWithUser tapis (:id sharee) app-id level) + (.unshareAppWithUser tapis (:id sharee) app-id)) (success-fn) (catch [:error_code ce/ERR_UNAVAILABLE] {:keys [reason]} - (log/error (:throwable &throw-context) "Agave app listing timed out") + (log/error (:throwable &throw-context) "Tapis app listing timed out") (failure-fn reason)) (catch clj-http-error? _ - (log/error (:throwable &throw-context) "HTTP error returned by Agave") + (log/error (:throwable &throw-context) "HTTP error returned by Tapis") (failure-fn (.getMessage (:throwable &throw-context)))) (catch Object _ - (log/error (:throwable &throw-context) "Uncaught error returned by Agave") + (log/error (:throwable &throw-context) "Uncaught error returned by Tapis") (failure-fn (.getMessage (:throwable &throw-context))))))) (defn share-app-with-subject - [agave app-names sharee app-id level] - (let [category-id (:id (.hpcAppGroup agave))] + [tapis app-names sharee app-id level] + (let [category-id (:id (.hpcAppGroup tapis))] (try-share-app-with-subject - agave sharee app-id level - #(app-permissions/app-sharing-success app-names jp/agave-client-name app-id level category-id category-id) - (partial - app-permissions/app-sharing-failure app-names jp/agave-client-name app-id level category-id category-id)))) + tapis sharee app-id level + #(app-permissions/app-sharing-success app-names jp/tapis-client-name app-id level category-id category-id) + (partial + app-permissions/app-sharing-failure app-names jp/tapis-client-name app-id level category-id category-id)))) (defn unshare-app-with-subject - [agave app-names sharee app-id] - (let [category-id (:id (.hpcAppGroup agave))] + [tapis app-names sharee app-id] + (let [category-id (:id (.hpcAppGroup tapis))] (try-share-app-with-subject - agave sharee app-id nil - #(app-permissions/app-unsharing-success app-names jp/agave-client-name app-id category-id) - (partial - app-permissions/app-unsharing-failure app-names jp/agave-client-name app-id category-id)))) + tapis sharee app-id nil + #(app-permissions/app-unsharing-success app-names jp/tapis-client-name app-id category-id) + (partial + app-permissions/app-unsharing-failure app-names jp/tapis-client-name app-id category-id)))) diff --git a/src/apps/service/apps_client.clj b/src/apps/service/apps_client.clj index dc9cf997..bab01608 100644 --- a/src/apps/service/apps_client.clj +++ b/src/apps/service/apps_client.clj @@ -1,14 +1,13 @@ (ns apps.service.apps-client (:require [apps.persistence.oauth :as op] [apps.protocols] - [apps.service.apps.agave] + [apps.service.apps.tapis] [apps.service.apps.combined] [apps.service.apps.de] [apps.service.oauth :refer [authorization-uri has-access-token]] [apps.user :as user] [apps.util.config :as config] - [clojure-commons.exception-util :as cxu] - [mescal.de :as agave] + [mescal.de :as tapis] [slingshot.slingshot :refer [throw+]])) (defn- authorization-redirect @@ -24,29 +23,29 @@ :reauth-callback (partial authorization-redirect server-info username state-info)) (authorization-redirect server-info username state-info))) -(defn- get-agave-client +(defn- get-tapis-client [state-info username] - (let [server-info (config/agave-oauth-settings)] - (agave/de-agave-client-v2 - (config/agave-base-url) - (config/agave-storage-system) - (partial get-access-token (config/agave-oauth-settings) state-info username) - (config/agave-jobs-enabled) - :timeout (config/agave-read-timeout) - :page-len (config/agave-page-length)))) + (let [server-info (config/tapis-oauth-settings)] + (tapis/de-tapis-client-v3 + (config/tapis-base-url) + (config/tapis-storage-system) + (partial get-access-token server-info state-info username) + (config/tapis-jobs-enabled) + :timeout (config/tapis-read-timeout) + :page-len (config/tapis-page-length)))) -(defn- get-agave-apps-client +(defn- get-tapis-apps-client [state-info {:keys [username] :as user}] - (apps.service.apps.agave.AgaveApps. - (get-agave-client state-info username) - (partial has-access-token (config/agave-oauth-settings) username) + (apps.service.apps.tapis.TapisApps. + (get-tapis-client state-info username) + (partial has-access-token (config/tapis-oauth-settings) username) user)) (defn- get-apps-client-list [user state-info] (vector (apps.service.apps.de.DeApps. user) - (when (and user (config/agave-enabled)) - (get-agave-apps-client state-info user)))) + (when (and user (config/tapis-enabled)) + (get-tapis-apps-client state-info user)))) (defn get-apps-client ([user] diff --git a/src/apps/service/callbacks.clj b/src/apps/service/callbacks.clj index a78155b9..9a8e06ca 100644 --- a/src/apps/service/callbacks.clj +++ b/src/apps/service/callbacks.clj @@ -11,10 +11,13 @@ (log/info (str "received a status update for DE job " uuid)) (apps/update-job-status uuid)) -(defn update-agave-job-status - [job-id last-updated {:keys [status external-id end-time]}] +(defn update-tapis-job-status + [job-id {{:keys [timestamp type data]} :event}] (service/assert-valid job-id "no job UUID provided") - (service/assert-valid status "no status provided") - (service/assert-valid external-id "no external job ID provided") - (log/info (str "received a status update for Agave job " external-id ": status = " status)) - (apps/update-job-status job-id external-id status (first (remove string/blank? [end-time last-updated])))) + (service/assert-valid type "no status provided") + (let [{:keys [jobUuid]} (service/parse-json data) + ; The `event.type` will be a string like "jobs.JOB_NEW_STATUS.FINISHED" + status (string/replace type #".*\." "")] + (service/assert-valid jobUuid "no external job ID provided") + (log/info (str "received a status update for Tapis job " jobUuid ": type = " type ", status = " status)) + (apps/update-job-status job-id jobUuid status timestamp))) diff --git a/src/apps/service/oauth.clj b/src/apps/service/oauth.clj index cb79387e..762ff4ac 100644 --- a/src/apps/service/oauth.clj +++ b/src/apps/service/oauth.clj @@ -5,7 +5,6 @@ [slingshot.slingshot :only [throw+]]) (:require [apps.persistence.oauth :as op] [apps.util.config :as config] - [apps.util.service :as service] [cemerick.url :as curl] [clojure-commons.exception-util :as cxu] [authy.core :as authy])) @@ -17,7 +16,7 @@ :token-callback token-callback)) (def ^:private server-info-fn-for - (memoize #(->> {:agave (when (config/agave-enabled) config/agave-oauth-settings)} + (memoize #(->> {:tapis (when (config/tapis-enabled) config/tapis-oauth-settings)} (remove-vals nil?)))) (defn- get-server-info diff --git a/src/apps/util/config.clj b/src/apps/util/config.clj index b0f5a299..71f4c2c9 100644 --- a/src/apps/util/config.clj +++ b/src/apps/util/config.clj @@ -41,15 +41,15 @@ [props config-valid configs] "apps.app.environment-name" "docker-compose") -(cc/defprop-optboolean agave-enabled - "Enables or disables all features that require connections to Agave." +(cc/defprop-optboolean tapis-enabled + "Enables or disables all features that require connections to Tapis." [props config-valid configs] - "apps.features.agave" true) + "apps.features.tapis" true) -(cc/defprop-optboolean agave-jobs-enabled - "Enables or disables Agave job submission." +(cc/defprop-optboolean tapis-jobs-enabled + "Enables or disables Tapis job submission." [props config-valid configs] - "apps.features.agave.jobs" false) + "apps.features.tapis.jobs" false) (cc/defprop-optstr db-driver-class "The name of the JDBC driver to use." @@ -236,65 +236,65 @@ [props config-valid configs] "apps.irods.path-max-len" 1067) -(cc/defprop-optstr agave-base-url - "The base URL to use when connecting to Agave." - [props config-valid configs agave-enabled] - "apps.agave.base-url" "https://agave.iplantc.org") +(cc/defprop-optstr tapis-base-url + "The base URL to use when connecting to Tapis." + [props config-valid configs tapis-enabled] + "apps.tapis.base-url" "https://cyverse.tapis.io/v3") -(cc/defprop-str agave-key - "The API key to use when authenticating to Agave." - [props config-valid configs agave-enabled] - "apps.agave.key") +(cc/defprop-str tapis-key + "The API key to use when authenticating to Tapis." + [props config-valid configs tapis-enabled] + "apps.tapis.key") -(cc/defprop-str agave-secret - "The API secret to use when authenticating to Agave." - [props config-valid configs agave-enabled] - "apps.agave.secret") +(cc/defprop-str tapis-secret + "The API secret to use when authenticating to Tapis." + [props config-valid configs tapis-enabled] + "apps.tapis.secret") -(cc/defprop-optstr agave-oauth-base - "The base URL for the Agave OAuth 2.0 endpoints." - [props config-valid configs agave-enabled] - "apps.agave.oauth-base" "https://agave.iplantc.org/oauth2") +(cc/defprop-optstr tapis-oauth-base + "The base URL for the Tapis OAuth 2.0 endpoints." + [props config-valid configs tapis-enabled] + "apps.tapis.oauth-base" "https://cyverse.tapis.io/v3/oauth2") -(cc/defprop-optint agave-oauth-refresh-window +(cc/defprop-optint tapis-oauth-refresh-window "The number of minutes before a token expires to refresh it." - [props config-valid configs agave-enabled] - "apps.agave.oauth-refresh-window" 5) - -(cc/defprop-str agave-redirect-uri - "The redirect URI used after Agave authorization." - [props config-valid configs agave-enabled] - "apps.agave.redirect-uri") - -(cc/defprop-str agave-callback-base - "The base URL for receiving job status update callbacks from Agave." - [props config-valid configs agave-enabled] - "apps.agave.callback-base") - -(cc/defprop-optstr agave-storage-system - "The storage system that Agave should use when interacting with the DE." - [props config-valid configs agave-enabled] - "apps.agave.storage-system" - "data.iplantcollaborative.org") - -(cc/defprop-optint agave-read-timeout - "The maximum amount of time to wait for a response from Agave in milliseconds." - [props config-valid configs agave-enabled] - "apps.agave.read-timeout" 10000) - -(cc/defprop-optint agave-page-length - "The maximum number of entities to receive from a single Agave service call." - [props config-valid configs agave-enabled] - "apps.agave.page-length" 5000) + [props config-valid configs tapis-enabled] + "apps.tapis.oauth-refresh-window" 5) + +(cc/defprop-str tapis-redirect-uri + "The redirect URI used after Tapis authorization." + [props config-valid configs tapis-enabled] + "apps.tapis.redirect-uri") + +(cc/defprop-str tapis-callback-base + "The base URL for receiving job status update callbacks from Tapis." + [props config-valid configs tapis-enabled] + "apps.tapis.callback-base") + +(cc/defprop-optstr tapis-storage-system + "The storage system that Tapis should use when interacting with the DE." + [props config-valid configs tapis-enabled] + "apps.tapis.storage-system" + "data.cyverse.org") + +(cc/defprop-optint tapis-read-timeout + "The maximum amount of time to wait for a response from Tapis in milliseconds." + [props config-valid configs tapis-enabled] + "apps.tapis.read-timeout" 10000) + +(cc/defprop-optint tapis-page-length + "The maximum number of entities to receive from a single Tapis service call." + [props config-valid configs tapis-enabled] + "apps.tapis.page-length" 5000) (cc/defprop-optstr pgp-keyring-path "The path to the PGP keyring file." - [props config-valid configs agave-enabled] + [props config-valid configs tapis-enabled] "apps.pgp.keyring-path" "/etc/iplant/crypto/de-2/secring.gpg") (cc/defprop-optstr pgp-key-password "The password used to unlock the PGP key." - [props config-valid configs agave-enabled] + [props config-valid configs tapis-enabled] "apps.pgp.key-password" "notprod") (cc/defprop-optstr analyses-base @@ -414,16 +414,16 @@ :redirect-uri redirect-uri :refresh-window (* refresh-window 60 1000)}) -(def agave-oauth-settings +(def tapis-oauth-settings (memoize #(oauth-settings - "agave" - (agave-key) - (agave-secret) - (str (curl/url (agave-oauth-base) "authorize")) - (str (curl/url (agave-oauth-base) "token")) - (agave-redirect-uri) - (agave-oauth-refresh-window)))) + "tapis" + (tapis-key) + (tapis-secret) + (str (curl/url (tapis-oauth-base) "authorize")) + (str (curl/url (tapis-oauth-base) "tokens")) + (tapis-redirect-uri) + (tapis-oauth-refresh-window)))) (def permissions-client (memoize #(pc/new-permissions-client (permissions-base))))