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

Make OSD Bootstrap more sturdy in CI #901

Merged
merged 14 commits into from
Aug 11, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Since Windows is inconsistent, we want to let other OSes run on a fail
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -51,11 +53,20 @@ jobs:
with:
path: OpenSearch-Dashboards/plugins/dashboards-observability

- name: Load Plugin Bootstrap cache
uses: actions/cache@v3
with:
path: |
**/node_modules
**/target
Copy link
Member

Choose a reason for hiding this comment

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

why is it caching target?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It showed up when I scanned for what files bootstrap was making, I assumed it may be important. I don't know the technical details of what bootstrap does, so I might have overselected.

Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure why bootstrap would touch target. target is the transpiled javascript from source code (public ts/tsx) to be executed in browser, yarn start (optimizing phase) and yarn build would update target.

caching it probably won't cause an issue even if your key does not consider source code changes (because yarn build will update target anyways), but i don't think it should be cached. it's not really related to dependencies

key: ${{ runner.os }}-bootstrap-${{ hashFiles('OpenSearch-Dashboards/yarn.lock', 'OpenSearch-Dashboards/plugins/dashboards-observability/yarn.lock') }}
restore-keys: ${{ runner.os }}-bootstrap-

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn osd bootstrap
cd OpenSearch-Dashboards
yarn config set network-timeout 1000000 -g
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this seconds?

Copy link
Collaborator Author

@Swiddis Swiddis Aug 11, 2023

Choose a reason for hiding this comment

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

Milliseconds, this PR uses the same number as is used in the OpenSearch Dashboards CI, which in turn is inspired by a related issue on yarn that suggests a similar approach with a number that's also in that ballpark.

yarn osd bootstrap || yarn osd bootstrap
Copy link
Member

Choose a reason for hiding this comment

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

this is ok but there's also a retry workflow https://github.com/marketplace/actions/retry-step


- name: Test all dashboards-observability modules
run: |
Expand All @@ -80,4 +91,4 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: dashboards-observability-${{ matrix.os }}
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build
Loading