Skip to content

Commit

Permalink
Moved contents of bundle-workflow to the root. (opensearch-project#678)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock committed Oct 6, 2021
1 parent b93f2e2 commit 386b779
Show file tree
Hide file tree
Showing 253 changed files with 369 additions and 379 deletions.
File renamed without changes.
11 changes: 5 additions & 6 deletions .github/workflows/bundle-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: bundle-workflow
on:
push:
paths:
- bundle-workflow/**
- src/**
- tests/**
pull_request:
paths:
- bundle-workflow/**
- src/**
- tests/**

jobs:
test:
Expand All @@ -18,9 +20,6 @@ jobs:
runs-on: ${{ matrix.os }}
env:
PYTHON_VERSION: 3.7
defaults:
run:
working-directory: ./bundle-workflow
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_VERSION }}
Expand All @@ -46,4 +45,4 @@ jobs:
- name: Upload Coverage Report
uses: codecov/codecov-action@v2
with:
files: ./bundle-workflow/coverage.xml
files: ./coverage.xml
2 changes: 1 addition & 1 deletion .github/workflows/manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
python -m pip install --upgrade pipenv wheel
- name: OpenSearch Manifests
run: |
./bundle-workflow/ci.sh ${{ matrix.manifest }} --snapshot
./ci.sh ${{ matrix.manifest }} --snapshot
2 changes: 1 addition & 1 deletion .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
key: ${{ runner.os }}-build-cache-maven-local
- name: Update OpenSearch Manifests
run: |
./bundle-workflow/manifests.sh update
./manifests.sh update
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ out.txt

/artifacts/
/bundle/
/bundle-workflow/artifacts/
/bundle-workflow/bundle/
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,21 @@ repos:
- id: isort
stages: [commit]
name: isort
entry: bash -c 'cd bundle-workflow && pipenv run isort --check .'
entry: bash -c 'pipenv run isort --check .'
language: system
types: [python]
files: ^bundle-workflow/
- id: flake8
stages: [commit]
name: flake8
entry: bash -c 'cd bundle-workflow && pipenv run flake8 .'
entry: bash -c 'pipenv run flake8 .'
language: system
files: ^bundle-workflow/
- id: mypy
stages: [commit]
name: mypy
entry: bash -c 'cd bundle-workflow && pipenv run mypy .'
entry: bash -c 'pipenv run mypy .'
language: system
files: ^bundle-workflow/
- id: pytest
stages: [commit]
name: pytest
entry: bash -c 'cd bundle-workflow && pipenv run pytest'
entry: bash -c 'pipenv run pytest'
language: system
files: ^bundle-workflow/
19 changes: 6 additions & 13 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ npm install -g yarn
Install dependencies.

```
cd bundle-workflow
~/.../bundle-workflow $ pipenv install
$ pipenv install
Installing dependencies from Pipfile.lock (1f4869)...
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Expand All @@ -80,16 +79,16 @@ Alternatively, run a command inside the virtualenv with pipenv run.

### Run Tests

This project uses [pytest](https://docs.pytest.org/en/6.x/) to ensure code quality. See [bundle-workflow/tests](bundle-workflow).
This project uses [pytest](https://docs.pytest.org/en/6.x/) to ensure code quality. See [tests](tests).

```
~/.../bundle-workflow $ pipenv run pytest
$ pipenv run pytest
2 passed in 02s
```

### Run bundle-workflow

Try running `./build.sh` from [bundle-workflow](./bundle-workflow). It should complete and show usage.
Try running `./build.sh`. It should complete and show usage.

```
$ ./build.sh
Expand Down Expand Up @@ -124,7 +123,7 @@ Use `isort .` to fix any sorting order.

```
$ pipenv run isort .
Fixing bundle-workflow/tests/system/test_arch.py
Fixing tests/system/test_arch.py
```

Use [black](https://black.readthedocs.io/en/stable/) to auto-format your code.
Expand All @@ -143,7 +142,7 @@ This project uses [mypy](https://github.com/python/mypy) as an optional static t

```
pipenv run mypy .
bundle-workflow/src/assemble.py:14: error: Cannot find implementation or library stub for module named "assemble_workflow.bundle"
src/assemble.py:14: error: Cannot find implementation or library stub for module named "assemble_workflow.bundle"
```

### Code Coverage
Expand All @@ -160,12 +159,6 @@ TOTAL 23491 12295 48%

### Pre-Commit Cheatsheet

Run from `bundle-workflow` before making pull requests.

```
cd bundle-workflow
```

The pre-commit hook checks for imports, type, style and test.

```
Expand Down
6 changes: 3 additions & 3 deletions bundle-workflow/Jenkinsfile → Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pipeline {
steps {
script {
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main'
sh "./bundle-workflow/build.sh manifests/$INPUT_MANIFEST --snapshot"
sh "./build.sh manifests/$INPUT_MANIFEST --snapshot"
withCredentials([usernamePassword(credentialsId: 'Sonatype', usernameVariable: 'SONATYPE_USERNAME', passwordVariable: 'SONATYPE_PASSWORD')]) {
sh('$WORKSPACE/publish/publish-snapshot.sh $WORKSPACE/artifacts/$ARTIFACT_PATH/maven')
}
Expand Down Expand Up @@ -120,8 +120,8 @@ pipeline {
void build() {
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main'

sh "./bundle-workflow/build.sh manifests/$INPUT_MANIFEST"
sh './bundle-workflow/assemble.sh artifacts/manifest.yml'
sh "./build.sh manifests/$INPUT_MANIFEST"
sh './assemble.sh artifacts/manifest.yml'

script { manifest = readYaml(file: 'artifacts/manifest.yml') }
def artifactPath = "${manifest.build.version}/${OPENSEARCH_BUILD_ID}/${manifest.build.architecture}";
Expand Down
10 changes: 5 additions & 5 deletions ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ This document describes steps to onboard a new plugin to release workflow for co

3. Ensure your `build.sh` reads and passes along both `-Dbuild.snapshot=` and `-Dopensearch.version=` flags. Snapshot builds should produce a -SNAPSHOT tagged artifact for example `opensearch-plugin-1.1.0.0-SNAPSHOT.zip` where a release build of the same component would produce `opensearch-plugin-1.1.0.0.zip`.

4. Execute `./bundle-workflow/build.sh` to ensure your component builds and all artifacts are correctly placed into ./artifacts/ with correct output names.
4. Execute `./build.sh` to ensure your component builds and all artifacts are correctly placed into ./artifacts/ with correct output names.

5. Execute `./bundle-workflow/assemble.sh` to ensure the full bundle is assembled and placed in to /bundles/*.tar.gz. Unpack the tarball to ensure all your components are placed in their correct locations.
5. Execute `./assemble.sh` to ensure the full bundle is assembled and placed in to /bundles/*.tar.gz. Unpack the tarball to ensure all your components are placed in their correct locations.

6. Publish a PR to this repo including the updated manifest and the names of the artifacts being added.

### Step 2: Onboard to `test-workflow`

1. Update the test configuration file, [test_manifest.yml](https://github.com/opensearch-project/opensearch-build/blob/main/bundle-workflow/src/test_workflow/config/test_manifest.yml), for a particular release, to include your plugin. This test configuration defines full suite of tests - `integ`, `bwc`, that can be run on the plugin.
1. Update the test configuration file, [test_manifest.yml](src/test_workflow/config/test_manifest.yml), for a particular release, to include your plugin. This test configuration defines full suite of tests - `integ`, `bwc`, that can be run on the plugin.

2. For integration testing, the `test-workflow` runs integration tests available in the plugin repository. You will need to add `integ-test` config for your plugin in test_manifest.yml, [example](https://github.com/opensearch-project/opensearch-build/blob/85bbe204e947d5d1579af771bbafe399c11cbd70/bundle-workflow/src/test_workflow/config/test_manifest.yml#L3).
2. For integration testing, the `test-workflow` runs integration tests available in the plugin repository. You will need to add `integ-test` config for your plugin in test_manifest.yml, [example](src/test_workflow/config/test_manifest.yml#L3).
1. It supports two test configs - `with-security` and `without-security`, which runs test with security plugin enabled and disabled respectively. Choose one or both depending on what your plugin integration tests support.
2. If your plugin is dependent on `job-scheduler` zip, you can define that in `build-dependencies` in the config. Currently, the test workflow only supports `job-scheduler` as build dependency. Please create an issue if your plugin needs more support.

3. For backward compatibility testing, the `test-workflow` runs backward compatibility tests available in the plugin repository, (see [reference]((https://github.com/opensearch-project/anomaly-detection/blob/d9a122d05282f7efc1e24c61d64f18dec0fd47af/build.gradle#L428))). Like integration test, it has a set of configurable options defined in test_manifest.yml, [example](https://github.com/opensearch-project/opensearch-build/blob/85bbe204e947d5d1579af771bbafe399c11cbd70/bundle-workflow/src/test_workflow/config/test_manifest.yml#L8).
3. For backward compatibility testing, the `test-workflow` runs backward compatibility tests available in the plugin repository, (see [reference]((https://github.com/opensearch-project/anomaly-detection/blob/d9a122d05282f7efc1e24c61d64f18dec0fd47af/build.gradle#L428))). Like integration test, it has a set of configurable options defined in test_manifest.yml, [example](src/test_workflow/config/test_manifest.yml#L8).
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 386b779

Please sign in to comment.