Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh committed Jul 27, 2022
1 parent 26b57fe commit 040ca0f
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
push:
pull_request:
paths:
- manifests/**/*.yml
- 'manifests/**/*.yml'
- '!manifests/templates/**/'
schedule:
- cron: 0 0 * * *

Expand Down
4 changes: 2 additions & 2 deletions manifests/templates/opensearch-dashboards/1.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
schema-version: '1.0'
build:
name: OpenSearch Dashboards
version: 1.3.4
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-dashboards-build-v2
components:
- name: OpenSearch-Dashboards
repository: https://github.com/opensearch-project/OpenSearch-Dashboards.git
ref: tags/1.3.4
ref: main
4 changes: 2 additions & 2 deletions manifests/templates/opensearch-dashboards/2.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
schema-version: '1.0'
build:
name: OpenSearch Dashboards
version: 2.1.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-dashboards-build-v2
components:
- name: OpenSearch-Dashboards
repository: https://github.com/opensearch-project/OpenSearch-Dashboards.git
ref: tags/2.1.0
ref: main
checks:
- npm:package:version
2 changes: 1 addition & 1 deletion manifests/templates/opensearch-dashboards/3.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
schema-version: '1.0'
build:
name: OpenSearch Dashboards
version: 3.0.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-dashboards-build-v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
schema-version: '1.0'
build:
name: OpenSearch Dashboards
version: 2.1.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-dashboards-build-v2
components:
- name: OpenSearch-Dashboards
repository: https://github.com/opensearch-project/OpenSearch-Dashboards.git
ref: tags/2.1.0
ref: main
checks:
- npm:package:version
4 changes: 2 additions & 2 deletions manifests/templates/opensearch/1.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
schema-version: '1.0'
build:
name: OpenSearch
version: 1.3.4
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2
args: -e JAVA_HOME=/opt/java/openjdk-11
components:
- name: OpenSearch
repository: https://github.com/opensearch-project/OpenSearch.git
ref: tags/1.3.4
ref: main
checks:
- gradle:publish
- gradle:properties:version
4 changes: 2 additions & 2 deletions manifests/templates/opensearch/2.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
schema-version: '1.0'
build:
name: OpenSearch
version: 2.1.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2
args: -e JAVA_HOME=/opt/java/openjdk-17
components:
- name: OpenSearch
repository: https://github.com/opensearch-project/OpenSearch.git
ref: tags/2.1.0
ref: main
checks:
- gradle:publish
- gradle:properties:version
2 changes: 1 addition & 1 deletion manifests/templates/opensearch/3.x/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
schema-version: '1.0'
build:
name: OpenSearch
version: 3.0.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2
Expand Down
2 changes: 1 addition & 1 deletion manifests/templates/opensearch/default/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
schema-version: '1.0'
build:
name: OpenSearch
version: 2.1.0
version: 'replace'
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2
Expand Down
7 changes: 6 additions & 1 deletion src/manifests_workflow/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ def branches(self, url: str) -> List[str]:
return branches

def to_dict(self) -> Any:
return Manifest.compact({"name": self.name, "repository": self.git_repo.url, "ref": self.git_repo.ref, "checks": self.checks})
return Manifest.compact({
"name": self.name,
"repository": self.git_repo.url,
"ref": self.git_repo.ref,
"checks": self.checks
})
2 changes: 1 addition & 1 deletion src/manifests_workflow/component_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def checkout(
branch: str = "main",
snapshot: bool = False,
working_directory: str = None,
) -> "ComponentOpenSearch":
) -> 'ComponentOpenSearch':
with GitRepository(
f"https://github.com/opensearch-project/{name}.git",
branch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def branches(self, url: str = "https://github.com/opensearch-project/OpenSearch-
return Component.branches(url)

@classmethod
def checkout(self, path: str, branch: str = "main", snapshot: bool = False) -> "ComponentOpenSearchDashboardsMin":
def checkout(self, path: str, branch: str = "main", snapshot: bool = False) -> 'ComponentOpenSearchDashboardsMin':
with GitRepository(
"https://github.com/opensearch-project/OpenSearch-Dashboards.git",
branch,
Expand Down
2 changes: 1 addition & 1 deletion src/manifests_workflow/component_opensearch_min.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def branches(self, url: str = "https://github.com/opensearch-project/OpenSearch.
return Component.branches(url)

@classmethod
def checkout(self, path: str, branch: str = "main", snapshot: bool = False) -> "ComponentOpenSearchMin":
def checkout(self, path: str, branch: str = "main", snapshot: bool = False) -> 'ComponentOpenSearchMin':
return ComponentOpenSearchMin(
GitRepository("https://github.com/opensearch-project/OpenSearch.git", branch, path),
snapshot,
Expand Down
14 changes: 7 additions & 7 deletions src/manifests_workflow/input_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ def create_manifest(self, version: str, components: List = []) -> InputManifest:
templates_base_path = os.path.join(self.manifests_path(), "templates")
template_version_folder = version.split(".")[0] + ".x"
template_full_path = os.path.join(templates_base_path, self.prefix, template_version_folder, "manifest.yml")
if os.path.exists(template_full_path):
input_manifest_templates = InputManifest.from_file(open(template_full_path))
else:
input_manifest_templates = InputManifest.from_file(open(os.path.join(templates_base_path, self.prefix, "default", "manifest.yml")))
if not os.path.exists(template_full_path):
template_full_path = os.path.join(templates_base_path, self.prefix, "default", "manifest.yml")

input_manifest_templates.build.version = version
manifest = InputManifest.from_file(open(template_full_path))

manifest.build.version = version
manifests_components = []

for component in components:
logging.info(f" Adding {component.name}")
manifests_components.append(component.to_dict())

input_manifest_templates.components = InputComponents(manifests_components) # type: ignore
return input_manifest_templates
manifest.components = InputComponents(manifests_components) # type: ignore
return manifest

def write_manifest(self, version: str, components: List = []) -> None:
logging.info(f"Creating new version: {version}")
Expand Down
9 changes: 3 additions & 6 deletions src/manifests_workflow/input_manifests_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ def __init__(self) -> None:
def files(self, name: str = "opensearch") -> List:
return InputManifests.files(name)

def update(
self,
min_klass: Union[Type[ComponentOpenSearchMin], Type[ComponentOpenSearchDashboardsMin]] = ComponentOpenSearchMin,
component_klass: Type[ComponentOpenSearch] = ComponentOpenSearch,
keep: bool = False,
) -> None:
def update(self, min_klass: Union[Type[ComponentOpenSearchMin], Type[ComponentOpenSearchDashboardsMin]] =
ComponentOpenSearchMin, component_klass: Type[ComponentOpenSearch] = ComponentOpenSearch,
keep: bool = False) -> None:
super().update(min_klass=ComponentOpenSearchMin, component_klass=ComponentOpenSearch, keep=keep)
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ def __init__(self) -> None:
def files(self, name: str = "opensearch-dashboards") -> List:
return InputManifests.files(name)

def update(
self,
min_klass: Union[Type[ComponentOpenSearchMin], Type[ComponentOpenSearchDashboardsMin]] = ComponentOpenSearchDashboardsMin,
component_klass: Type[ComponentOpenSearch] = None,
keep: bool = False,
) -> None:
def update(self, min_klass: Union[Type[ComponentOpenSearchMin], Type[ComponentOpenSearchDashboardsMin]] =
ComponentOpenSearchDashboardsMin, component_klass: Type[ComponentOpenSearch] = None,
keep: bool = False) -> None:
super().update(min_klass=ComponentOpenSearchDashboardsMin, component_klass=None, keep=keep)

0 comments on commit 040ca0f

Please sign in to comment.