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

Build OpenSearch on Windows #767

Merged
merged 5 commits into from
Oct 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests on Windows.
Signed-off-by: dblock <dblock@dblock.org>
dblock committed Oct 21, 2021
commit 55d364c6e649615cdfcb61e8b41695339ab8bf24
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
PYTHON_VERSION: 3.7
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -16,3 +16,5 @@ out.txt

/artifacts/
/bundle/

/.vscode/
8 changes: 6 additions & 2 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ Fork this repository on GitHub, and clone locally with `git clone`.

#### Pyenv

Use pyenv to manage multiple versions of Python. This can be installed with [pyenv-installer](https://github.com/pyenv/pyenv-installer).
Use pyenv to manage multiple versions of Python. This can be installed with [pyenv-installer](https://github.com/pyenv/pyenv-installer) on Linux and MacOS, and [pyenv-win](https://github.com/pyenv-win/pyenv-win#installation) on Windows.

```
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
@@ -42,7 +42,7 @@ Python 3.7.11
If you are using pyenv.

```
pyenv install 3.7.12
pyenv install 3.7.12 # use 3.7.9 on Windows, the latest at the time of writing this
pyenv global 3.7.12
```

@@ -57,7 +57,10 @@ $ pipenv --version
pipenv, version 19.0
```

On Windows, run `pyenv rehash` if `pipenv` cannot be found. This rehashes pyenv shims, creating a `pipenv` file in `/.pyenv/pyenv-win/shims/`.

#### NVM and Node

Install [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) to use the Node 10.24.1 version as it is required

```
@@ -66,6 +69,7 @@ nvm install v10.24.1
```

#### Yarn

[Yarn](https://classic.yarnpkg.com/en/docs/install) is required for building and running the OpenSearch Dashboards and plugins

```
117 changes: 67 additions & 50 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assemble_workflow/bundle_opensearch.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@
class BundleOpenSearch(Bundle):
def install_plugin(self, plugin):
tmp_path = self._copy_component(plugin, "plugins")
cli_path = os.path.join(self.archive_path, "bin/opensearch-plugin")
cli_path = os.path.join(self.archive_path, "bin", "opensearch-plugin")
self._execute(f"{cli_path} install --batch file:{tmp_path}")
super().install_plugin(plugin)
2 changes: 1 addition & 1 deletion src/assemble_workflow/bundle_opensearch_dashboards.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@
class BundleOpenSearchDashboards(Bundle):
def install_plugin(self, plugin):
tmp_path = self._copy_component(plugin, "plugins")
cli_path = os.path.join(self.archive_path, "bin/opensearch-dashboards-plugin")
cli_path = os.path.join(self.archive_path, "bin", "opensearch-dashboards-plugin")
self._execute(f"{cli_path} --allow-root install file:{tmp_path}")
super().install_plugin(plugin)
3 changes: 2 additions & 1 deletion src/build_workflow/build_args.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@

import argparse
import logging
import os
import sys


@@ -75,7 +76,7 @@ def __init__(self):
self.keep = args.keep
self.platform = args.platform
self.architecture = args.architecture
self.script_path = sys.argv[0].replace("/src/run_build.py", "/build.sh")
self.script_path = sys.argv[0].replace(os.path.sep + os.path.join("src", "run_build.py"), f"{os.path.sep}build.sh")
Copy link
Member

@gaiksaya gaiksaya Oct 21, 2021

Choose a reason for hiding this comment

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

Interesting os.path.sep


def component_command(self, name):
return " ".join(
3 changes: 2 additions & 1 deletion src/ci_workflow/ci_args.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@

import argparse
import logging
import os
import sys


@@ -45,7 +46,7 @@ def __init__(self):
self.component = args.component
self.keep = args.keep
self.logging_level = args.logging_level
self.script_path = sys.argv[0].replace("/src/run_ci.py", "/ci.sh")
self.script_path = sys.argv[0].replace(os.path.sep + os.path.join("src", "run_ci.py"), f"{os.path.sep}ci.sh")

def component_command(self, name):
return " ".join(
Loading