Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Change CD workflow to use new staging bucket for artifacts #248

Conversation

camerski
Copy link

@camerski camerski commented Oct 13, 2020

PLEASE DO NOT MERGE THIS REQUEST UNTIL ASKED. We need to coordinate the merge with updating Github secrets.

Description of changes:
The infrastructure team is separating the production and staging locations into different AWS accounts. Plugins need to modify their workflows to publish to the new locations.

This PR changes the CD workflow to add a build number and write the zip, deb, and rpm plugin artifacts to staging.artifacts.opendistroforelasticsearch.amazon.com. The write to S3 currently fails because the secrets have not been updated; the secrets will be updated at the same time this PR is merged.

The workflow currently fails due to an unrelated JaCoCo issue: https://github.com/camerski/anomaly-detection/actions/runs/305267309

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@camerski camerski requested a review from a team October 13, 2020 21:55
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #248 into master will increase coverage by 1.08%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #248      +/-   ##
============================================
+ Coverage     71.60%   72.69%   +1.08%     
- Complexity     1352     1420      +68     
============================================
  Files           153      160       +7     
  Lines          6406     6680     +274     
  Branches        490      508      +18     
============================================
+ Hits           4587     4856     +269     
+ Misses         1587     1575      -12     
- Partials        232      249      +17     
Flag Coverage Δ Complexity Δ
#plugin 71.90% <ø> (+1.26%) 1420.00 <ø> (+68.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...search/ad/rest/RestIndexAnomalyDetectorAction.java 46.93% <0.00%> (-7.12%) 3.00% <0.00%> (ø%)
...ransport/DeleteAnomalyDetectorTransportAction.java 54.21% <0.00%> (-4.82%) 15.00% <0.00%> (-1.00%)
...sticsearch/ad/indices/AnomalyDetectionIndices.java 61.59% <0.00%> (-2.90%) 23.00% <0.00%> (-3.00%)
...stroforelasticsearch/ad/model/AnomalyDetector.java 64.02% <0.00%> (-2.26%) 51.00% <0.00%> (+5.00%) ⬇️
...distroforelasticsearch/ad/constant/CommonName.java 66.66% <0.00%> (ø) 1.00% <0.00%> (ø%)
...stroforelasticsearch/ad/AnomalyDetectorPlugin.java 93.54% <0.00%> (ø) 10.00% <0.00%> (ø%)
...ticsearch/ad/settings/AnomalyDetectorSettings.java 100.00% <0.00%> (ø) 1.00% <0.00%> (ø%)
...csearch/ad/rest/handler/AbstractActionHandler.java
...earch/ad/transport/AnomalyDetectorJobResponse.java 75.00% <0.00%> (ø) 4.00% <0.00%> (?%)
...transport/IndexAnomalyDetectorTransportAction.java 92.00% <0.00%> (ø) 3.00% <0.00%> (?%)
... and 10 more

rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm`
deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb`

s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshot/elasticsearch-plugins/anomaly-detection/"
Copy link
Contributor

Choose a reason for hiding this comment

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

So all plugins are uploading artifact to staging only in CD workflow ? Don't see production location in this file. Where will the production location be used ?

Copy link
Author

Choose a reason for hiding this comment

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

The infrastructure team will promote artifacts to production as part of the ODFE release process. For out-of-cycle releases, you can promote the artifacts to production using your own workflows, or the infrastructure team can help.

deb=`ls build/distributions/*.deb`

# Inject the build number before the suffix
zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
Copy link
Contributor

Choose a reason for hiding this comment

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

GITHUB_RUN_NUMBER is unique number for each run, so the artifact name will be unique for each run, while the original artifact name keep the same for same version. Is this change compatible with current CD workflow?

Copy link
Author

Choose a reason for hiding this comment

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

We are making corresponding changes to how we generate ODFE distributions to handle the change to the naming convention. If you need to do an out-of-cycle release then there may be manual work required; the infrastructure team can help with that.

@ohltyler ohltyler added the infra label Oct 19, 2020
@gaiksaya
Copy link
Member

gaiksaya commented Jan 9, 2021

More changes were required but unable to access the specified branch. Hence closing this PR and raising a new one #358

@gaiksaya gaiksaya closed this Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants