Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecarton/cumulus 3751 s3 task #3910

Open
wants to merge 367 commits into
base: feature/CUMULUS-3751
Choose a base branch
from

Conversation

etcart
Copy link
Contributor

@etcart etcart commented Jan 28, 2025

Summary: 3751 just the s3 copy part
Addresses CUMULUS-3751: Move granules across collections

Changes

  • task for copying granules' s3 files from one collection to another
  • workflow and integration test for this s3 file copy, which is intended to be expanded to include the rest of the workflow as those are ready

PR Checklist

  • Update CHANGELOG
  • Unit tests
  • Ad-hoc testing - Deploy changes and test manually
  • Integration tests

etcart and others added 30 commits December 10, 2024 14:42
* Update migration to remove vacuum statements that can time out in a Lambda env

* Remove additional vacuum statements

* Add CL
…s to launch templates (#3880)

* CUMULUS-3759:Migrated ECS Autoscaling group from launch configurations to launch templates

* update tf resources

* add ec2 container service policy

* update userdata format

* add cumulus-std deployment config

* update autoscaling_cf_template

* delete userdata file

* rename

* instance refresh lifecycle

* no need AmazonEC2ContainerServiceforEC2Role?

* migrate fakeprovider to launch templates

* refactor

* remove variable from cumulus-std
await recursivelyDeleteS3Bucket(t.context.systemBucket);
});

test.serial('Should move files to final location with cmr xml file', async (t) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: test titles should probably include thing being tested (e.g. changeGranuleCollectionS3 should....)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also 'copy files'

);
});

test.afterEach.always(async (t) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also kill the topic created in the beforeEach

(urlObject) => urlObject.URL
);

t.true(onlineAccessURLs.includes(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit/Suggestion: Use t.assert(assertion, text) so we avoid output like "false is not true"

'MOD11A1.A2017200.h19v04.006.2017201090724.cmr.xml'
);

const CollectionInformation = UMM.Granule.Collection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably a minor quibble, but we're not directly testing that it only changed this value. Thoughts?

@@ -0,0 +1,1000 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests as exist look good, but there are enough methods abstracted we should probably more directly test them (happy path concerns) beyond 'did the files move', particularly if we're asserting just that an object exists and the like.

@@ -0,0 +1,45 @@
# @cumulus/change-granule-collection-s3

This lambda function moves granules between collections in s3 and in postgres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions: Should probably not read 'move', and updates CMR metadata

cmrGranuleUrlType = 'both',
distributionBucketMap,
}) {
const updatemetadataObject = cloneDeep(metadataObject);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: camelCase

Copy link
Member

@Jkovarik Jkovarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(no updates, just writing out pending comments)

);
granuleId = inputPayload.granules[0].granuleId;

ingestExecutionArn = await buildAndStartWorkflow(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could probably make this go faster and/or reduce the potential for random failures if we just setup the granule directly/via API rather than run a workflow, particularly given this is a single Lambda invocation. I'm going to take a stab at that.

}
});
beforeAll(async () => {
const inputPayloadFilename = './spec/parallel/ingestGranule/IngestGranule.input.payload.json';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't use a payload from another test, replication is fine here, or moving it to test-data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants