diff --git a/bin/create-dotenv b/bin/create-dotenv index 78daceb50..97f0897f5 100755 --- a/bin/create-dotenv +++ b/bin/create-dotenv @@ -58,7 +58,7 @@ EOF echo "KUBE_CONTEXT=minikube" >> .env fi else - echo -e "\nLOCALLY_DEPLOYED_SERVICES=harmony-service-example,giovanni-adapter\n" >> .env + echo -e "\nLOCALLY_DEPLOYED_SERVICES=harmony-service-example\n" >> .env fi fi diff --git a/config/services.yml b/config/services.yml index 5fb3f1f03..10ac6ffe6 100644 --- a/config/services.yml +++ b/config/services.yml @@ -49,9 +49,9 @@ https://cmr.earthdata.nasa.gov: - image: !Env ${QUERY_CMR_IMAGE} is_sequential: true - - name: gesdisc/giovanni + - name: giovanni-time-series-adapter description: | - A service to compose the Giovanni URL and invoke Giovanni service to produce output file to visualize, analyze, + A service to compose the Giovanni URL for a time series and invoke Giovanni service to produce output file to visualize, analyze, and access vast amounts of Earth science remote sensing data without having to download the data. data_operation_version: '0.20.0' has_granule_limit: false @@ -78,7 +78,7 @@ https://cmr.earthdata.nasa.gov: output_formats: - text/csv steps: - - image: !Env ${GIOVANNI_ADAPTER_IMAGE} + - image: !Env ${GIOVANNI_TIME_SERIES_ADAPTER_IMAGE} operations: ['variableSubset', 'temporalSubset'] - name: podaac/l2-subsetter diff --git a/docs/guides/managing-existing-services.md b/docs/guides/managing-existing-services.md index 9fe07f88c..0133349c8 100644 --- a/docs/guides/managing-existing-services.md +++ b/docs/guides/managing-existing-services.md @@ -31,7 +31,7 @@ The returned JSON response is a map of canonical service names to tags: "podaac-ps3": "latest", "podaac-netcdf-converter": "latest", "query-cmr": "latest", - "giovanni-adapter": "latest", + "giovanni-time-series-adapter": "latest", "geoloco": "latest", "subset-band-name": "latest" } @@ -114,7 +114,7 @@ The returned JSON response has the fields indicating the current status of the s { "deploymentId": "befb50e0-e467-4776-86c8-e7218f1123cc", "username": "yliu10", - "service": "giovanni-adapter", + "service": "harmony-service-example", "tag": "new-version", "regressionTestVersion": "1.0.0", "status": "successful", diff --git a/services/harmony/app/backends/deployment-callback.ts b/services/harmony/app/backends/deployment-callback.ts index 2db0756ff..df560a552 100644 --- a/services/harmony/app/backends/deployment-callback.ts +++ b/services/harmony/app/backends/deployment-callback.ts @@ -13,9 +13,9 @@ import _ from 'lodash'; * image - full image url with tag for the deployed service * serviceQueueUrls - a list contains the service image to queue url mapping as defined in HarmonyEnv class. * Here is an example: - * \{"deployService":"giovanni-adapter", - * "image":"123456.dkr.ecr.us-west-2.amazonaws.com/harmonyservices/giovanni-adapter:latest", - * "serviceQueueUrls":"[\"123456.dkr.ecr.us-west-2.amazonaws.com/harmonyservices/giovanni-adapter:latest.....\"]"\} + * \{"deployService":"harmony-service-example", + * "image":"123456.dkr.ecr.us-west-2.amazonaws.com/harmonyservices/service-example:latest", + * "serviceQueueUrls":"[\"123456.dkr.ecr.us-west-2.amazonaws.com/harmonyservices/service-example:latest.....\"]"\} * @param req - The request sent by the client * @param res - The response to send to the client */ diff --git a/services/harmony/app/frontends/request-metrics.ts b/services/harmony/app/frontends/request-metrics.ts index f8865f854..d5372eeae 100644 --- a/services/harmony/app/frontends/request-metrics.ts +++ b/services/harmony/app/frontends/request-metrics.ts @@ -16,7 +16,7 @@ export const metricsFields = [ 'reproject', 'synchronous', 'spatialSubset', 'shapefileSubset', 'chainLength', 'harmonyGdalAdapter', 'harmonyServiceExample', 'harmonyNetcdfToZarr', 'swathProjector', 'hoss', 'sdsMaskfill', 'trajectorySubsetter', 'podaacConcise', - 'podaacL2Subsetter', 'giovanniAdapter', + 'podaacL2Subsetter', 'giovanniTimeSeriesAdapter', ]; interface RequestMetrics { @@ -29,7 +29,7 @@ interface RequestMetrics { trajectorySubsetter: number; podaacConcise: number; podaacL2Subsetter: number; - giovanniAdapter: number; + giovanniTimeSeriesAdapter: number; numInputGranules: number; totalGranuleSizeMb: number; timeTakenSeconds: number; @@ -77,8 +77,8 @@ function getServiceNameFromID(serviceID: string, logger: Logger): string { case /podaac\/l2ss-py/.test(serviceID): serviceName = 'podaacL2Subsetter'; break; - case /giovanni-adapter/.test(serviceID): - serviceName = 'giovanniAdapter'; + case /giovanni-time-series-adapter/.test(serviceID): + serviceName = 'giovanniTimeSeriesAdapter'; break; case /query\-cmr/.test(serviceID): break; @@ -105,7 +105,7 @@ function getServiceMetricsFromSteps(steps: WorkflowStep[], logger: Logger): Part trajectorySubsetter: 0, podaacConcise: 0, podaacL2Subsetter: 0, - giovanniAdapter: 0, + giovanniTimeSeriesAdapter: 0, numVariables: 0, concatenate: 0, reproject: 0, diff --git a/services/harmony/env-defaults b/services/harmony/env-defaults index 8c03a8af4..8f75d8c39 100644 --- a/services/harmony/env-defaults +++ b/services/harmony/env-defaults @@ -229,10 +229,11 @@ LOG_STDOUT=false # The services to deploy locally. A comma-separated list of services that the bin/deploy-services # script should attempt to deploy. By default only a couple of harmony example services are deployed. # When specifying another service to be deployed make sure the name matches the lower and dash case -# prefix for the image variable name. For example to deploy the Giovanni adapter image which has -# a variable name of GIOVANNI_ADAPTER_IMAGE you would specify giovanni-adapter (converting to lowercase -# and dash case and dropping _IMAGE. Make sure if the image for the service is not publicly available -# that you have built the docker image locally, otherwise the service will fail to start. +# prefix for the image variable name. For example to deploy the harmony service example image which +# has a variable name of HARMONY_SERVICE_EXAMPLE_IMAGE you would specify harmony-service-example +# (converting to lowercase, converting to dash case, and dropping _IMAGE). Make sure if the image +# for the service is not publicly available that you have built the docker image locally, otherwise +# the service will fail to start. LOCALLY_DEPLOYED_SERVICES=harmony-service-example # Local development: Use the following to set the Kubernetes context used by start scripts diff --git a/services/harmony/test/deployment-callback.ts b/services/harmony/test/deployment-callback.ts index d53bc9879..aa6fa8310 100644 --- a/services/harmony/test/deployment-callback.ts +++ b/services/harmony/test/deployment-callback.ts @@ -4,13 +4,13 @@ import hookServersStartStop from './helpers/servers'; import { getServiceConfigs } from '../app/models/services'; import { ServiceConfig } from '../app/models/services/base-service'; -const serviceName = 'gesdisc/giovanni'; -const serviceNewTag = 'harmonyservices/giovanni-adapter:newtag'; +const serviceName = 'harmony/service-example'; +const serviceNewTag = 'harmonyservices/service-example:newtag'; const callbackMessage = { - deployService: 'giovanni-adapter', + deployService: 'harmony-service-example', image: serviceNewTag, - serviceQueueUrls: '["harmonyservices/giovanni-adapter:test,https://sqs.us-west-2.amazonaws.com/123456/giovanni-adapter-test-0-sandbox"]', + serviceQueueUrls: '["harmonyservices/harmony-service-example:test,https://sqs.us-west-2.amazonaws.com/123456/harmony-service-example-test-0-sandbox"]', }; /** @@ -22,13 +22,15 @@ const callbackMessage = { function findImageByName(configs: ServiceConfig[], targetName: string): string | undefined { for (const config of configs) { if (config.name === targetName) { - // Assuming the first step has the desired image - const firstStep = config.steps[0]; - if (firstStep && firstStep.image) { - return firstStep.image; + // Assuming the second step has the desired image + const secondStep = config.steps[1]; + if (secondStep && secondStep.image) { + return secondStep.image; } } } + + return undefined; } @@ -37,12 +39,12 @@ describe('Deployment callback endpoint', async function () { let originalImage; before(function () { // Save the original process.env - originalImage = process.env.GIOVANNI_ADAPTER_IMAGE; + originalImage = process.env.HARMONY_SERVICE_EXAMPLE_IMAGE; }); after(function () { // Restore the original process.env after test - process.env.GIOVANNI_ADAPTER_IMAGE = originalImage; + process.env.HARMONY_SERVICE_EXAMPLE_IMAGE = originalImage; }); describe('handle callback message', function () { @@ -101,8 +103,17 @@ describe('Deployment callback endpoint', async function () { .set('Content-Type', 'application/json'); }); - after(function () { + after(async function () { delete this.res; + // Set the image back to the original tag to prevent breaking other tests outside this file + // loadServiceConfigs(env.cmrEndpoint); + const originalImageCallback = callbackMessage; + originalImageCallback.image = 'harmonyservices/service-example:latest'; + await request(this.backend) + .post('/service/deployment-callback') + .send(originalImageCallback) + .set('cookie-secret', process.env.COOKIE_SECRET) + .set('Content-Type', 'application/json'); }); it('runs the request successfully', async function () { @@ -115,7 +126,7 @@ describe('Deployment callback endpoint', async function () { it('updates the image tag', async function () { let serviceImage = findImageByName(configs, serviceName); - expect(serviceImage).to.equal('harmonyservices/giovanni-adapter:latest'); + expect(serviceImage).to.equal('harmonyservices/service-example:latest'); // get the service config again and verify that it is updated to the new tag serviceImage = findImageByName(getServiceConfigs(), serviceName); expect(serviceImage).to.equal(serviceNewTag); diff --git a/services/harmony/test/helpers/servers.ts b/services/harmony/test/helpers/servers.ts index c05f47d37..c26d89cd9 100644 --- a/services/harmony/test/helpers/servers.ts +++ b/services/harmony/test/helpers/servers.ts @@ -46,7 +46,7 @@ export default function hookServersStartStop(opts = { skipEarthdataLogin: true } this.backend = servers.backend; stub(env, 'callbackUrlRoot').get(() => `http://127.0.0.1:${servers.backend.address().port}`); - const locallyDeployedServices = 'giovanni-adapter,harmony-service-example,' + + const locallyDeployedServices = 'giovanni-time-series-adapter,harmony-service-example,' + 'harmony-netcdf-to-zarr,var-subsetter,swath-projector,harmony-gdal-adapter,' + 'podaac-concise,sds-maskfill,trajectory-subsetter,podaac-l2-subsetter,harmony-regridder,' + 'hybig,geoloco,stitchee,batchee,hoss,subset-band-name'; diff --git a/services/harmony/test/helpers/work-items.ts b/services/harmony/test/helpers/work-items.ts index eb6b5ad6e..32298e75c 100644 --- a/services/harmony/test/helpers/work-items.ts +++ b/services/harmony/test/helpers/work-items.ts @@ -13,7 +13,7 @@ import { objectStoreForProtocol } from '../../app/util/object-store'; export const exampleWorkItemProps = { jobID: '1', - serviceID: 'harmony-services/query-cmr:latest', + serviceID: 'harmony-services/query-cmr:stable', status: WorkItemStatus.READY, workflowStepIndex: 0, } as WorkItemRecord; diff --git a/services/harmony/test/helpers/workflow-steps.ts b/services/harmony/test/helpers/workflow-steps.ts index 90e92618c..2bb0fb200 100644 --- a/services/harmony/test/helpers/workflow-steps.ts +++ b/services/harmony/test/helpers/workflow-steps.ts @@ -38,7 +38,7 @@ export const validOperationWithManyVariables = operationWithManyVariables.serial const exampleProps = { jobID: '1', - serviceID: 'harmony-services/query-cmr:latest', + serviceID: 'harmony-services/query-cmr:stable', stepIndex: 0, workItemCount: 10, operation: validOperation, diff --git a/services/harmony/test/service-image-tags.ts b/services/harmony/test/service-image-tags.ts index be533b577..3764b6600 100644 --- a/services/harmony/test/service-image-tags.ts +++ b/services/harmony/test/service-image-tags.ts @@ -23,7 +23,7 @@ import { stub } from 'sinon'; const serviceImages = { 'batchee': 'latest', 'geoloco': 'latest', - 'giovanni-adapter': 'latest', + 'giovanni-time-series-adapter': '1.0.0', 'harmony-gdal-adapter': 'latest', 'harmony-netcdf-to-zarr': 'latest', 'harmony-regridder': 'latest', @@ -230,19 +230,13 @@ describe('ecrImageNameToComponents', function () { describe('Service image endpoint', async function () { let envStub; beforeEach(function () { - envStub = stub(env, 'locallyDeployedServices').get(() => 'giovanni-adapter,harmony-service-example,harmony-netcdf-to-zarr,var-subsetter,swath-projector,harmony-gdal-adapter,podaac-concise,sds-maskfill,trajectory-subsetter,podaac-l2-subsetter,harmony-regridder,hybig,geoloco'); + envStub = stub(env, 'locallyDeployedServices').get(() => 'harmony-service-example,harmony-netcdf-to-zarr,var-subsetter,swath-projector,harmony-gdal-adapter,podaac-concise,sds-maskfill,trajectory-subsetter,podaac-l2-subsetter,harmony-regridder,hybig,geoloco'); }); afterEach(function () { envStub.restore(); }); - const locallyDeployedServices = 'giovanni-adapter,harmony-service-example,harmony-netcdf-to-zarr,var-subsetter,swath-projector,harmony-gdal-adapter,podaac-concise,sds-maskfill,trajectory-subsetter,podaac-l2-subsetter,harmony-regridder,hybig,geoloco,subset-band-name'; - - beforeEach(function () { - process.env.LOCALLY_DEPLOYED_SERVICES = locallyDeployedServices; - }); - hookServersStartStop({ skipEarthdataLogin: false }); describe('List service images', async function () { diff --git a/services/harmony/test/service-metrics-backends.ts b/services/harmony/test/service-metrics-backends.ts index 46f2f5eb2..d79f76d33 100644 --- a/services/harmony/test/service-metrics-backends.ts +++ b/services/harmony/test/service-metrics-backends.ts @@ -101,7 +101,7 @@ describe('Backend service metrics endpoint', function () { }); describe('when hitting the service/metrics endpoint with an existing serviceID', async function () { - const serviceID = 'harmony/query-cmr:latest'; + const serviceID = 'harmony/query-cmr:stable'; // The number of work items that should be returned for each of the job statuses const testParametersList = [