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

Add Priortized CUDs attribution tool. #395

Merged
merged 30 commits into from
Apr 13, 2020

Conversation

arifkasim
Copy link
Contributor

A tool that allows customers to prioritize a specific scope (e.g. project or folder) to attribute committed use discounts to first before letting any unconsumed discount float to other parts of an organization.

PSO Eng Bug Id = 135540892

@googlebot googlebot added the cla: yes All committers have signed a CLA label Jan 24, 2020
Copy link

@jaketf jaketf left a comment

Choose a reason for hiding this comment

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

First round of review comments



# Upload dependencies folder to DAG folder in Composer Bucket
resource "google_storage_bucket_object" "dag_init_upload" {
Copy link

Choose a reason for hiding this comment

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

I've been told it is poor form to deploy software like this with terraform.
Would cloud build be a more appropriate tool staging all these files for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly, I used the same terraform recommendations from this tool, as recommended by morgante.

Copy link

Choose a reason for hiding this comment

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

Respectfully, disagree that this is a similar pattern to the other tool
In the deployment process for the other tool you zip up source trees.
Here you require a contributor to manage each source file (including pesky __init__.py's) as a separate GCS object which is much more error prone.
Having a deployment process that runs `gsutil -m rsync -r ${local_dags_dir} gs://${composer_bucket}/dags would be much preferable.

PTAL at this simple cloud build example we have for deploying dags and see if you can adapt it for your use in this asset.

Aside,
We're working on a more fully baked CI/CD process for composer (deck, source) for composer but it is not quite ready yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@jaketf
Copy link

jaketf commented Feb 13, 2020

@kardiff18
@bmenasha
@bipinupd
FYI @arifkasim may need some help addressing feedback.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no All committers have NOT signed a CLA and removed cla: yes All committers have signed a CLA labels Apr 2, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes All committers have signed a CLA and removed cla: no All committers have NOT signed a CLA labels Apr 3, 2020
schedule_interval=datetime.timedelta(days=1),
default_args=DEFAULT_DAG_ARGS) as dag:

def format_commitment_table(env_vars: Dict[str, Union[str, bool]]) -> None:
Copy link

Choose a reason for hiding this comment

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

bump.

@jaketf
Copy link

jaketf commented Apr 9, 2020

This is getting close:

  • I'd like to see a cleaner deployment process of python source to Composer.
  • there have been quite a few changes so I'd like to see a last end to end test of deploying this from scratch.

@kardiff18
Copy link
Contributor

Simplified GCS upload in both CLI & terraform to be one step, meaning that I added in a folder within the DAG rather than doing everything at the root. @arifkasim this might affect your tests - please rerun them.

Also changed to jinja templating.

I've tested the full workflow in both the CLI & terraform and verifies that it works and produces the output table. Once Arif can run through his test suite once to verify outputs match, then should be good from our side. @jaketf PTAL and let us know if there's anything else, thanks!

@arifkasim
Copy link
Contributor Author

arifkasim commented Apr 11, 2020

@kardiff18 I made the changes to tests to be compatible with jinja templates. All tests work now.

Copy link

@jaketf jaketf left a comment

Choose a reason for hiding this comment

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

LGTM

@jaketf jaketf merged commit 55ee7a9 into GoogleCloudPlatform:master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes All committers have signed a CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants