diff --git a/docs/source/build.rst b/docs/source/build.rst deleted file mode 100644 index c8a4f046..00000000 --- a/docs/source/build.rst +++ /dev/null @@ -1,10 +0,0 @@ -Build -===== - -.. toctree:: - :maxdepth: 3 - :caption: Contents: - -.. click:: riocli.build:build - :prog: rio build - :nested: full diff --git a/docs/source/index.rst b/docs/source/index.rst index baacb80a..a3b67f49 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -59,7 +59,6 @@ Rapyuta CLI has commands for all rapyuta.io resources. You can read more about t Apply Authentication - Build Chart Completion Deployment diff --git a/riocli/apply/manifests/build.yaml b/riocli/apply/manifests/build.yaml deleted file mode 100644 index 5a71aa0b..00000000 --- a/riocli/apply/manifests/build.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# Deprecated. Builds support will be removed soon. ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "build-docker" -spec: - buildMethod: "Docker" - docker: - architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] - dockerfile: Dockerfile - pullSecret: "secret-guid" - isRos: True - rosDistro: melodic - simulation: False - repository: - url: "https://github.com/rapyuta-robotics/io_tutorial.git" - # gitRef: "master" - # secret: "secret-guid" - # dockerfile: "Dockerfile" - # pullSecret: "secret-guid" - # contextDir: "talker/talker" - # pushRepository: "rrdockerhub/test" - # pushSecret: "secret-guid" - # tagName: "tag-name" - # triggerName: "trigger-name" - # webhookURL: "http://webhook.url" ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "docker-ros-build" -spec: - recipe: "Docker" - docker: - architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] - dockerfile: Dockerfile - pullSecret: "secret-guid" - isRos: True - rosDistro: melodic - simulation: False - repository: - url: "https://github.com/rapyuta-robotics/io_tutorials" - ref: "master" - gitSecret: "secret-guid" - contextDir: "talker/talker" - image: - registry: - pushSecret: "" - tagName: "" - triggerName: "" - webhookURL: "" - rosDistro: "melodic" - buildMethod: "Source" ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "catkin-build" -spec: - buildMethod: "Source" - architecture: "amd64" - repository: - url: "https://github.com/rapyuta-robotics/io_tutorials" - ref: "master" - gitSecret: "secret-guid" - contextDir: "talker/talker" - image: - registry: - pushSecret: "" - tagName: "" - triggerName: "" - webhookURL: "" - catkin: - architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] - isRos: True - rosDistro: melodic - simulation: False - catkinParameters: - - rosPackages: "" - cmakeArguments: "" - makeArguments: "" - catkinMakeArguments: "" - blacklist: "" diff --git a/riocli/apply/manifests/package-nonros-cloud.yaml b/riocli/apply/manifests/package-nonros-cloud.yaml index efff4400..7b29f174 100644 --- a/riocli/apply/manifests/package-nonros-cloud.yaml +++ b/riocli/apply/manifests/package-nonros-cloud.yaml @@ -12,20 +12,8 @@ spec: cloud: replicas: 1 # Required executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "sleep infinity" - runAsBash: True - simulation: False - limits: - cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] - memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "sleep infinity" runAsBash: True simulation: False diff --git a/riocli/apply/manifests/package-nonros-device.yaml b/riocli/apply/manifests/package-nonros-device.yaml index e7b057ed..4bd39f98 100644 --- a/riocli/apply/manifests/package-nonros-device.yaml +++ b/riocli/apply/manifests/package-nonros-device.yaml @@ -13,28 +13,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: # Optional - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - exec: - command: - - "shell-cmd" - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: # Optional @@ -58,7 +38,7 @@ spec: kind: secret nameOrGUID: "secret-docker" - name: "exec-preInstalled" - type: preInstalled # Options: [docker (default), build, preInstalled] + type: preInstalled # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" environmentArgs: - name: "key1" # Required diff --git a/riocli/apply/manifests/package-ros-cloud.yaml b/riocli/apply/manifests/package-ros-cloud.yaml index 261bd3bf..b852ee40 100644 --- a/riocli/apply/manifests/package-ros-cloud.yaml +++ b/riocli/apply/manifests/package-ros-cloud.yaml @@ -12,20 +12,8 @@ spec: cloud: replicas: 1 # Required executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - simulation: False - limits: - cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] - memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True simulation: False diff --git a/riocli/apply/manifests/package-ros-device-no-rosbag.yaml b/riocli/apply/manifests/package-ros-device-no-rosbag.yaml index 87348d7e..14162dbf 100644 --- a/riocli/apply/manifests/package-ros-device-no-rosbag.yaml +++ b/riocli/apply/manifests/package-ros-device-no-rosbag.yaml @@ -14,27 +14,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: # Optional - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - tcpSocket: - port: 999 - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: # Optional @@ -57,7 +38,7 @@ spec: kind: secret nameOrGUID: "secret-docker" - name: "exec-preInstalled" - type: preInstalled # Options: [docker (default), build, preInstalled] + type: preInstalled # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" environmentArgs: - name: "key1" # Required diff --git a/riocli/apply/manifests/package-ros-device-rosbag.yaml b/riocli/apply/manifests/package-ros-device-rosbag.yaml index 17f21afe..7711efd9 100644 --- a/riocli/apply/manifests/package-ros-device-rosbag.yaml +++ b/riocli/apply/manifests/package-ros-device-rosbag.yaml @@ -14,28 +14,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: # Optional - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - httpGet: - path: "/" - port: 90 - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: # Optional diff --git a/riocli/apply/manifests/package.yaml b/riocli/apply/manifests/package.yaml index b030c5f2..8c81ae5c 100644 --- a/riocli/apply/manifests/package.yaml +++ b/riocli/apply/manifests/package.yaml @@ -12,20 +12,8 @@ spec: cloud: replicas: 1 # Required executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - simulation: False - limits: - cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] - memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True simulation: False @@ -159,28 +147,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: # Optional - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - exec: - command: - - "shell-cmd" - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: # Optional @@ -308,20 +276,8 @@ spec: cloud: replicas: 1 # Required executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "sleep infinity" - runAsBash: True - simulation: False - limits: - cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] - memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "sleep infinity" runAsBash: True simulation: False @@ -387,28 +343,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: # Optional - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - exec: - command: - - "shell-cmd" - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker-01" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: # Optional @@ -430,7 +366,7 @@ spec: kind: secret nameOrGUID: "secret-docker" - name: "exec-docker-02" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] runAsBash: True limits: # Optional cpu: 0.025 # Unit: Core (Optional) @@ -448,7 +384,7 @@ spec: image: "nginx:latest" imagePullPolicy: "Always" # Always, Never, IfNotPresent(default) - name: "exec-preInstalled" - type: preInstalled # Options: [docker (default), build, preInstalled] + type: preInstalled # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" environmentArgs: - name: "key1" # Required @@ -476,28 +412,8 @@ spec: arch: amd64 # Options: [arm32v7, arm64v8, amd64] restart: always # Options: [always, never, onfailure] executables: # Required - - name: "exec-build" - type: build # Options: [docker (default), build, preInstalled] - command: "roslaunch talker talker.launch" - runAsBash: True - limits: - cpu: 0.025 # Unit: Core (Optional) - memory: 128 # Unit: MB (Optional) - livenessProbe: # Optional - exec: - command: - - "shell-cmd" - initialDelaySeconds: 5 # Number of seconds after the container has started before liveness probes are initiated. - periodSeconds: 10 # How often (in seconds) to perform the probe. - failureThreshold: 1 # Minimum consecutive failures for the probe to be considered failed after having succeeded. - successThreshold: 3 # Minimum consecutive successes for the probe to be considered successful after having failed. - timeoutSeconds: 1 # Number of seconds after which the probe times out. - build: - depends: - kind: build - nameOrGUID: "build" - name: "exec-docker" - type: docker # Options: [docker (default), build, preInstalled] + type: docker # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" runAsBash: True limits: @@ -520,7 +436,7 @@ spec: kind: secret nameOrGUID: "secret-docker" - name: "exec-preInstalled" - type: preInstalled # Options: [docker (default), build, preInstalled] + type: preInstalled # Options: [docker (default), preInstalled] command: "roslaunch talker talker.launch" environmentArgs: - name: "key1" # Required diff --git a/riocli/apply/parse.py b/riocli/apply/parse.py index f78adffc..c7399cb0 100644 --- a/riocli/apply/parse.py +++ b/riocli/apply/parse.py @@ -40,7 +40,6 @@ class Applier(object): "secret": 3, "package": 3, "staticroute": 3, - "build": 180, "disk": 180, "deployment": 240, "network": 120, diff --git a/riocli/apply/resolver.py b/riocli/apply/resolver.py index 41dd2deb..817a7096 100644 --- a/riocli/apply/resolver.py +++ b/riocli/apply/resolver.py @@ -20,7 +20,6 @@ from rapyuta_io import DeploymentPhaseConstants from rapyuta_io.utils.rest_client import HttpMethod, RestClient -from riocli.build.model import Build from riocli.config import new_v2_client from riocli.config.config import Configuration from riocli.deployment.model import Deployment @@ -49,7 +48,6 @@ class ResolverCache(object, metaclass=_Singleton): KIND_TO_CLASS = { 'Project': Project, 'Secret': Secret, - 'Build': Build, 'Device': Device, 'Network': Network, 'StaticRoute': StaticRoute, @@ -66,7 +64,6 @@ class ResolverCache(object, metaclass=_Singleton): "secret": "^secret-[a-z]{24}$", "package": "^pkg-[a-z]{24}$", "staticroute": "^staticroute-[a-z]{24}$", - "build": "^build-[a-z]{24}$", "disk": "^disk-[a-z]{24}$", "deployment": "^dep-[a-z]{24}$", "network": "^net-[a-z]{24}$", @@ -76,7 +73,7 @@ class ResolverCache(object, metaclass=_Singleton): } GUID_KEYS = ['guid', 'GUID', 'deploymentId', 'uuid', 'ID', 'Id', 'id'] - NAME_KEYS = ['name', 'urlPrefix', 'buildName'] + NAME_KEYS = ['name', 'urlPrefix'] def __init__(self, client): self.client = client @@ -123,7 +120,6 @@ def _guid_functor(self, kind): "project": lambda x: munchify(x).metadata.guid, "package": lambda x: munchify(x)['id'], "staticroute": lambda x: munchify(x)['metadata']['guid'], - "build": lambda x: munchify(x)['guid'], "deployment": lambda x: munchify(x)['deploymentId'], "network": lambda x: munchify(x).guid, # This is only temporarily like this @@ -140,7 +136,6 @@ def _list_functors(self, kind): "project": self.v2client.list_projects, "package": self.client.get_all_packages, "staticroute": self.v2client.list_static_routes, - "build": self.client.list_builds, "deployment": functools.partial(self.client.get_all_deployments, phases=[DeploymentPhaseConstants.SUCCEEDED, DeploymentPhaseConstants.PROVISIONING]), @@ -161,7 +156,6 @@ def _find_functors(self, kind): lambda x: name == x.name and version == x['packageVersion'], obj_list), "staticroute": lambda name, obj_list: filter( lambda x: name == x.metadata.name.rsplit('-', 1)[0], obj_list), - "build": self._generate_find_guid_functor(name_field='buildName'), "deployment": self._generate_find_guid_functor(), "network": self._generate_find_guid_functor(), "disk": self._generate_find_guid_functor(), diff --git a/riocli/bootstrap.py b/riocli/bootstrap.py index 245e693a..7841155f 100644 --- a/riocli/bootstrap.py +++ b/riocli/bootstrap.py @@ -24,7 +24,6 @@ from riocli.apply import apply, explain, delete, template from riocli.auth import auth -from riocli.build import build from riocli.chart import chart from riocli.completion import completion from riocli.config import Configuration @@ -121,7 +120,6 @@ def update(silent: bool) -> None: cli.add_command(auth) cli.add_command(project) cli.add_command(device) -cli.add_command(build) cli.add_command(secret) cli.add_command(package) cli.add_command(deployment) diff --git a/riocli/build/__init__.py b/riocli/build/__init__.py deleted file mode 100644 index 0f646838..00000000 --- a/riocli/build/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import click -from click_help_colors import HelpColorsGroup - -from riocli.build.create import create_build -from riocli.build.delete import delete_build -from riocli.build.import_build import import_build -from riocli.build.inspect import inspect_build -from riocli.build.list import list_builds -from riocli.build.logs import build_logs -from riocli.build.trigger import trigger_build - - -@click.group( - invoke_without_command=False, - cls=HelpColorsGroup, - help_headers_color='yellow', - help_options_color='green', -) -def build() -> None: - """ - Build the source code as a Docker image - """ - pass - - -build.add_command(create_build) -build.add_command(delete_build) -build.add_command(import_build) -build.add_command(list_builds) -build.add_command(inspect_build) -build.add_command(build_logs) -build.add_command(trigger_build) diff --git a/riocli/build/create.py b/riocli/build/create.py deleted file mode 100644 index 5da74e90..00000000 --- a/riocli/build/create.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import click -from click_spinner import spinner -from rapyuta_io import Build, SimulationOptions - -from riocli.config import new_client - - -@click.command('create', hidden=True) -@click.option('--strategy', type=click.Choice(['Source', 'Docker']), default='Docker', - help='Strategy for building the Source') -@click.option('--branch', default='', help='Git Repository branch') -@click.option('--context', help='Context directory relative to the Git Repository root', default='') -@click.option('--arch', help='Architecture for the Build', - type=click.Choice(['amd64', 'arm32v7', 'arm64v8']), default='amd64') -@click.option('--ros/--no-ros', is_flag=True, help='Flag to enable ROS support', default=False) -@click.option('--sim/--no-sim', is_flag=True, help='Flag to enable Simulation support', default=False) -@click.option('--ros-distro', help='ROS Distribution to use for the Build', - type=click.Choice(['kinetic', 'melodic', 'noetic'], case_sensitive=True), default='melodic') -@click.option('--dockerfile', help='Path of Dockerfile, relative to the Context directory', default=None) -@click.option('--secret', help='Secret for the private git repository', default='') -@click.option('--docker-push-secret', help='Docker secret for pushing the image to an external registry.', - default='') -@click.option('--docker-push-repository', help='External docker repository where Build will push the image.', - default='') -@click.option('--trigger-name', type=str, help='Trigger name of the build', default='') -@click.option('--wait', type=bool, help='Wait for the Build to complete', default=False) -@click.argument('build-name', type=str) -@click.argument('repository', type=str) -def create_build(build_name: str, repository: str, strategy: str, branch: str, context: str, arch: str, ros: bool, - sim: bool, secret: str, ros_distro: str, trigger_name: str, dockerfile: str, docker_push_secret: str, - docker_push_repository: str, wait: bool) -> None: - """ - Create a new build on the Platform - """ - try: - simulation = SimulationOptions(sim) - build = Build(buildName=build_name, strategyType=strategy, repository=repository, architecture=arch, isRos=ros, - contextDir=context, simulationOptions=simulation, branch=branch, rosDistro=ros_distro, - secret=secret, triggerName=trigger_name, dockerPushSecret=docker_push_secret, - dockerPushRepository=docker_push_repository) - if strategy == 'Dockerfile': - build.buildInfo.dockerFilePath = dockerfile - client = new_client() - with spinner(): - build = client.create_build(build) - if wait: - build.poll_build_till_ready() - click.secho('Created build successfully!', fg='green') - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) diff --git a/riocli/build/delete.py b/riocli/build/delete.py deleted file mode 100644 index 705d5509..00000000 --- a/riocli/build/delete.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import click -from click_spinner import spinner - -from riocli.build.util import name_to_guid -from riocli.config import new_client - - -@click.command('delete') -@click.option('--force', '-f', 'force', is_flag=True, default=False, help='Skip confirmation') -@click.argument('build-name', required=True) -@name_to_guid -def delete_build(build_name: str, build_guid: str, force: bool): - """ - Delete the build from the Platform - """ - if not force: - click.confirm('Deleting build {} ({})'.format(build_name, build_guid), abort=True) - - try: - client = new_client() - with spinner(): - client.delete_build(build_guid) - click.echo(click.style('Build deleted successfully!', fg='green')) - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) diff --git a/riocli/build/import_build.py b/riocli/build/import_build.py deleted file mode 100644 index 09227d67..00000000 --- a/riocli/build/import_build.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os - -import click -from click_help_colors import HelpColorsGroup -from click_spinner import spinner -from rapyuta_io import Build, StrategyType, DeviceArch, SimulationOptions - -from riocli.config import new_client -from riocli.utils import run_bash -from riocli.utils.selector import show_selection - - -@click.group( - 'import', - hidden=True, - invoke_without_command=False, - cls=HelpColorsGroup, - help_headers_color='yellow', - help_options_color='green', -) -def import_build(): - """ - Imports the build from the Shell context automagically - """ - pass - - -@import_build.command('docker') -@click.option('--arch', help='Architecture for the Build', - type=click.Choice(['amd64', 'arm32v7', 'arm64v8']), default='amd64') -@click.option('--ros/--no-ros', is_flag=True, help='Flag to enable ROS support', default=False) -@click.option('--sim/--no-sim', is_flag=True, help='Flag to enable Simulation support', default=False) -@click.option('--ros-distro', help='ROS Distribution to use for the Build', - type=click.Choice(['kinetic', 'melodic'], case_sensitive=True), default='melodic') -@click.option('--wait', type=bool, help='Wait for the Build to complete', default=False) -def import_docker_build(arch: str, ros: bool, ros_distro: str, sim: bool, wait: bool) -> None: - """ - Imports the build from the current repository based on Dockerfiles - """ - try: - build = _gather_information() - build.buildInfo.architecture = arch - simulation = SimulationOptions(sim) - build.buildInfo.simulationOptions = simulation - build.buildInfo.isROS = ros - if ros: - build.buildInfo.rosDistro = ros_distro - client = new_client() - with spinner(): - build = client.create_build(build) - if wait: - build.poll_build_till_ready() - click.secho('Created build successfully!', fg='green') - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - -def _gather_information() -> Build: - directory = os.path.basename(run_bash('pwd')) - repository = run_bash('git remote get-url --all origin') - repository = _sanitize_repository(repository) - branch = run_bash('git symbolic-ref HEAD').replace('refs/heads/', '') - name = '{}___{}'.format(directory, branch.replace('/', '-')) - - dockerfiles = run_bash("find . -name *Dockerfile*").split("\n") - if len(dockerfiles) == 0 or dockerfiles[0] == '': - raise Exception('No Dockerfile found') - elif len(dockerfiles) == 1: - choice = dockerfiles[0] - else: - choice = show_selection(dockerfiles, header='Which Dockerfile do you want to use') - - return Build(buildName=name, strategyType=StrategyType.DOCKER, repository=repository, architecture=DeviceArch.AMD64, - dockerFilePath=choice) - - -def _sanitize_repository(repository: str) -> str: - if 'github.com' in repository: - return repository.replace("git@github.com:", "git://github.com/") - - # TODO: Add handling for more providers here! - return repository diff --git a/riocli/build/inspect.py b/riocli/build/inspect.py deleted file mode 100644 index 5182115e..00000000 --- a/riocli/build/inspect.py +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import click -from rapyuta_io import Build - -from riocli.build.util import name_to_guid -from riocli.config import new_client -from riocli.utils import inspect_with_format - - -@click.command('inspect') -@click.option('--format', '-f', 'format_type', default='yaml', - type=click.Choice(['json', 'yaml'], case_sensitive=False)) -@click.argument('build-name', required=True) -@name_to_guid -def inspect_build(format_type: str, build_guid: str, build_name: str) -> None: - """ - Inspect the build resource - """ - try: - client = new_client() - build = client.get_build(build_guid, include_build_requests=True) - data = make_build_inspectable(build) - inspect_with_format(data, format_type) - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - -def make_build_inspectable(build: Build) -> dict: - build_requests = make_build_requests_inspectable(build) - build_info = make_build_info_inspectable(build) - return { - 'created_at': build.CreatedAt, - 'updated_at': build.UpdatedAt, - 'deleted_at': build.DeletedAt, - 'guid': build.guid, - 'build_generation': build.buildGeneration, - 'build_name': build.buildName, - 'build_info': build_info, - 'status': build.status, - 'owner_project': build.ownerProject, - 'creator': build.creator, - 'docker_pull_info': build.dockerPullInfo, - 'build_requests': build_requests, - 'secret': build.secret, - 'docker_pull_secret': build.dockerPullSecret, - 'docker_push_secret': build.dockerPushSecret, - 'docker_push_repository': build.dockerPushRepository, - } - - -def make_build_info_inspectable(build: Build) -> dict: - build_info = build.buildInfo - return { - 'repository': build_info.repository, - 'strategy_type': build_info.strategyType, - 'architecture': build_info.architecture, - 'is_ros': build_info.isRos, - 'ros_distro': build_info.rosDistro, - 'simulation_options': { - 'simulation': build_info.simulationOptions.simulation - }, - 'build_options': build_info.buildOptions, - 'branch': build_info.branch, - 'docker_file_path': build_info.dockerFilePath, - 'context_dir': build_info.contextDir, - } - - -def make_build_requests_inspectable(build: Build) -> list: - build_request_data = [] - for build_request in build.buildRequests: - build_request_data.append({ - 'created_at': build_request['CreatedAt'], - 'updated_at': build_request['UpdatedAt'], - 'deleted_at': build_request['DeletedAt'], - 'request_id': build_request['requestId'], - 'is_complete': build_request['isComplete'], - 'error_string': build_request['errorString'], - 'owner_project': build_request['ownerProject'], - 'creator': build_request['creator'], - 'trigger_name': build_request['triggerName'], - 'build_generation': build_request['buildGeneration'], - 'git_metadata': make_git_metadata_inspectable(build_request['gitMetadata']), - 'executable_image_info': make_executable_image_info_inspectable(build_request['executableImageInfo']), - }) - return build_request_data - - -def make_git_metadata_inspectable(git_metadata: dict) -> dict: - guid = list(git_metadata.keys())[0] - guid_details = git_metadata[guid] - guid_value = { - 'author': { - 'email': guid_details['author']['email'], - 'name': guid_details['author']['name'], - }, - 'branch': guid_details['branch'], - 'commit': guid_details['commit'], - 'committer': { - 'email': guid_details['committer']['email'], - 'name': guid_details['committer']['name'], - }, - 'message': guid_details['message'], - 'repository_url': guid_details['repositoryUrl'] - } - return { - guid: guid_value - } - - -def make_executable_image_info_inspectable(exec_img_info: dict) -> dict: - image_info_list = [] - for img_info in exec_img_info['imageInfo']: - image_info_list.append({ - 'artifact_id': img_info['artifactID'], - 'image_name': img_info['imageName'], - }) - return { - 'image_info': image_info_list - } diff --git a/riocli/build/list.py b/riocli/build/list.py deleted file mode 100644 index 25d2e705..00000000 --- a/riocli/build/list.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import typing - -import click -from rapyuta_io import Build - -from riocli.config import new_client -from riocli.utils import tabulate_data - - -@click.command('list') -@click.option('--phase', 'status', multiple=True, help='Filter the Builds list by Phases', - type=click.Choice(['BuildInProgress', 'Complete', 'BuildFailed']), - default=['BuildInProgress', 'Complete', 'BuildFailed']) -def list_builds(status: typing.List[str]) -> None: - """ - List the builds in the selected project - """ - try: - client = new_client() - builds = client.list_builds(statuses=list(status)) - _display_build_list(builds, show_header=True) - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - -def _display_build_list(builds: typing.List[Build], show_header: bool = True): - headers = [] - if show_header: - headers = ('Build ID', 'Name', 'Status', 'Strategy', 'Repository') - - data = [] - for build in builds: - data.append([ - build.guid, build.buildName, build.status, - build.buildInfo.strategyType.value, build.buildInfo.repository - ]) - - tabulate_data(data, headers) diff --git a/riocli/build/logs.py b/riocli/build/logs.py deleted file mode 100644 index bcf40cfa..00000000 --- a/riocli/build/logs.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os - -import click - -from riocli.build.util import name_to_guid -from riocli.config import Configuration - -_LOG_URL_FORMAT = '{}/logs/build?buildRequestId={}' - - -@click.command('logs') -@click.argument('build-name', type=str) -@name_to_guid -def build_logs(build_name: str, build_guid: str) -> None: - """ - Stream the live logs for the Build - """ - try: - stream_build_logs(build_guid) - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - -def stream_build_logs(build_guid: str) -> None: - config = Configuration() - client = config.new_client() - build = client.get_build(build_guid, include_build_requests=True) - build_request_id = build.buildRequests[-1]['requestId'] - url = get_log_stream_url(config, build_request_id) - auth = config.get_auth_header() - curl = 'curl -H "project: {}" -H "Authorization: {}" "{}"'.format(auth['project'], auth['Authorization'], url) - click.secho(curl, fg='blue') - os.system(curl) - - -def get_log_stream_url(config: Configuration, build_request_id: str) -> str: - catalog_host = config.data.get('catalog_host', 'https://gacatalog.apps.rapyuta.io') - return _LOG_URL_FORMAT.format(catalog_host, build_request_id) diff --git a/riocli/build/model.py b/riocli/build/model.py deleted file mode 100644 index 5ef3714d..00000000 --- a/riocli/build/model.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2022 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import typing - -from rapyuta_io import Build as v1Build, Client, BuildOptions, CatkinOption - -from riocli.jsonschema.validate import load_schema -from riocli.model import Model - - -class Build(Model): - - def __init__(self, *args, **kwargs): - self.update(*args, **kwargs) - - def find_object(self, client: Client) -> bool: - guid, obj = self.rc.find_depends( - {"kind": "build", "nameOrGUID": self.metadata.name}) - if not guid: - return False - - return obj - - def create_object(self, client: Client, **kwargs) -> v1Build: - build = client.create_build(build=self.to_v1()) - return build - - def update_object(self, client: Client, obj: typing.Any) -> None: - pass - - def delete_object(self, client: Client, obj: typing.Any) -> typing.Any: - obj.delete() - - def to_v1(self) -> v1Build: - build_opts = None - if self.spec.buildMethod == 'Source' and self.spec.get('catkinParameters', None): - catkin_opts = [] - for each in self.spec.catkinParameters: - catkin_opt = CatkinOption(rosPkgs=each.get('rosPackages', None), - makeArgs=each.get('makeArguments', None), - cmakeArgs=each.get('cmakeArguments', None), - catkinMakeArgs=each.get('catkinMakeArguments', None), - blacklist=each.get('blacklist', None)) - catkin_opts.append(catkin_opt) - build_opts = BuildOptions(catkin_opts) - - return v1Build( - buildName=self.metadata.name, strategyType=self.spec.buildMethod, repository=self.spec.repository.url, - architecture=self.spec.architecture, rosDistro=self.spec.get('rosDistro', ''), - isRos=self.spec.get('rosDistro', '') != '', dockerPullSecret=self.spec.get('pullSecret', ''), - contextDir=self.spec.get('contextDir', ''), dockerFilePath=self.spec.get('dockerfile', ''), - dockerPushRepository=self.spec.get('pushSecret', ''), branch=self.spec.repository.get('ref', ''), - triggerName=self.spec.get('triggerName', ''), tagName=self.spec.get('tagName', ''), - buildOptions=build_opts - ) - - @classmethod - def pre_process(cls, client: Client, d: typing.Dict) -> None: - pass - - @staticmethod - def validate(data): - """ - Validates if build data is matching with its corresponding schema - """ - schema = load_schema('build') - schema.validate(data) diff --git a/riocli/build/trigger.py b/riocli/build/trigger.py deleted file mode 100644 index dd10d7ee..00000000 --- a/riocli/build/trigger.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import click -from click_spinner import spinner -from rapyuta_io import BuildOperation, BuildOperationInfo - -from riocli.build.logs import stream_build_logs -from riocli.build.util import name_to_guid -from riocli.config import new_client - - -@click.command('trigger') -@click.option('--name', 'trigger_name', type=str, help='Name for the Trigger [optional]', default=None) -@click.option('--tail', 'tail', is_flag=True, type=bool, default=False, - help='Tail the logs after triggering the build') -@click.argument('build-name', type=str) -@name_to_guid -def trigger_build(build_name: str, build_guid: str, trigger_name: str, tail: bool) -> None: - """ - Trigger a build request for the build - """ - try: - client = new_client() - with spinner(): - client.trigger_build(BuildOperation([BuildOperationInfo(build_guid, triggerName=trigger_name)])) - click.secho('Triggered build successfully!', fg='green') - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - if tail: - stream_build_logs(build_guid) diff --git a/riocli/build/util.py b/riocli/build/util.py deleted file mode 100644 index 2d4f3f0a..00000000 --- a/riocli/build/util.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2021 Rapyuta Robotics -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import functools -import typing - -import click -from rapyuta_io import Client - -from riocli.config import new_client - - -def name_to_guid(f: typing.Callable) -> typing.Callable: - @functools.wraps(f) - def decorated(**kwargs: typing.Any): - client = new_client() - name = kwargs.pop('build_name') - guid = None - - if name.startswith('build-'): - guid = name - name = None - - if name is None: - name = get_build_name(client, guid) - - if guid is None: - try: - guid = find_build_guid(client, name) - except Exception as e: - click.secho(str(e), fg='red') - raise SystemExit(1) - - kwargs['build_name'] = name - kwargs['build_guid'] = guid - f(**kwargs) - - return decorated - - -def get_build_name(client: Client, guid: str) -> str: - build = client.get_build(guid=guid) - return build.buildName - - -def find_build_guid(client: Client, name: str) -> str: - builds = client.list_builds() - for build in builds: - if build.buildName == name: - return build.guid - - raise BuildNotFound() - - -class BuildNotFound(Exception): - def __init__(self, message='build not found!'): - self.message = message - super().__init__(self.message) diff --git a/riocli/deployment/update.py b/riocli/deployment/update.py index e16da2bf..52c95b0a 100644 --- a/riocli/deployment/update.py +++ b/riocli/deployment/update.py @@ -153,15 +153,12 @@ def get_component_context(component_info) -> dict: for e in exec_metadata: # Component will be considered only if any of its executables is - # docker or build - if not (e.get("docker") or e.get("buildGUID")): + # docker + if not (e.get("docker")): continue executable = {} - if e.get("buildGUID"): - executable["buildGUID"] = e["buildGUID"] - if e.get("docker"): executable["docker"] = e["docker"] diff --git a/riocli/jsonschema/schemas/build-schema.yaml b/riocli/jsonschema/schemas/build-schema.yaml deleted file mode 100644 index 68bfadbc..00000000 --- a/riocli/jsonschema/schemas/build-schema.yaml +++ /dev/null @@ -1,213 +0,0 @@ ---- -$schema: https://json-schema.org/draft-07/schema -title: Build -$ref: "#/definitions/build" -definitions: - build: - type: object - properties: - apiVersion: - const: apiextensions.rapyuta.io/v1 - kind: - const: Build - metadata: - "$ref": "#/definitions/metadata" - spec: - "$ref": "#/definitions/buildSpec" - status: - "$ref": "#/definitions/buildStatus" - required: - - apiVersion - - kind - - metadata - - spec - metadata: - type: object - properties: - name: - type: string - guid: - "$ref": "#/definitions/buildGUID" - creator: - "$ref": "#/definitions/uuid" - project: - "$ref": "#/definitions/projectGUID" - labels: - "$ref": "#/definitions/stringMap" - uniqueItems: true - required: - - name - projectGUID: - type: string - pattern: "^project-([a-z0-9]{20}|[a-z]{24})$" - buildGUID: - type: string - pattern: "^build-[a-z]{24}$" - secretGUID: - type: string - pattern: "^secret-[a-z]{24}$" - stringMap: - type: object - additionalProperties: - type: string - uuid: - type: string - pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" - buildSpec: - type: object - properties: - repository: - type: object - properties: - url: - type: string - ref: - type: string - contextDir: - type: string - gitSecret: - "$ref": "#/definitions/secretGUID" - buildMethod: - "$ref": "#/definitions/buildRecipe" - required: - - buildMethod - - repository - dependencies: - buildMethod: - oneOf: - - properties: - buildMethod: - enum: - - Docker - docker: - type: object - "$ref": "#/definitions/docker" - image: - "$ref": "#/definitions/imageArtifact" - - properties: - buildMethod: - enum: - - Source - catkin: - type: object - "$ref": "#/definitions/catkin" - image: - "$ref": "#/definitions/imageArtifact" - docker: - type: object - properties: - architecture: - "$ref": "#/definitions/architecture" - dockerfile: - type: string - default: Dockerfile - pullSecret: - "$ref": "#/definitions/secretGUID" - - isRos: - type: boolean - rosDistro: - "$ref": "#/definitions/rosDistro" - simulation: - type: boolean - default: false - - dependentRequired: - isRos: - - rosDistro - - simulation - - catkin: - type: object - properties: - architecture: - "$ref": "#/definitions/architecture" - - isRos: - type: boolean - const: true - default: true - - rosDistro: - "$ref": "#/definitions/rosDistro" - - simulation: - type: boolean - default: false - - catkinParameters: - "$ref": "#/definitions/catkinParameters" - required: - - isRos - - rosDistro - - simulation - - architecture - - imageArtifact: - type: object - properties: - registry: - type: string - pushSecret: - type: string - tagName: - type: string - triggerName: - type: string - webhookURL: - type: string - - buildStatus: - type: object - properties: - status: - "$ref": "#/definitions/buildStatusType" - generation: - type: integer - buildStatusType: - enum: - - Complete - - BuildFailed - - BuildInProgress - gitInfo: - type: object - properties: - repository: - type: string - gitRef: - type: string - secret: - "$ref": "#/definitions/secretGUID" - required: - - repository - catkinParameters: - type: array - items: - "$ref": "#/definitions/catkinParameter" - catkinParameter: - type: object - properties: - rosPackages: - type: string - cmakeArguments: - type: string - makeArguments: - type: string - catkinMakeArguments: - type: string - blacklist: - type: string - buildRecipe: - enum: - - Docker - - Source - architecture: - enum: - - amd64 - - arm32v7 - - arm64v8 - rosDistro: - enum: - - melodic - - kinetic - - noetic diff --git a/riocli/jsonschema/schemas/deployment-schema.yaml b/riocli/jsonschema/schemas/deployment-schema.yaml index c770a971..6ce2527c 100755 --- a/riocli/jsonschema/schemas/deployment-schema.yaml +++ b/riocli/jsonschema/schemas/deployment-schema.yaml @@ -401,9 +401,6 @@ definitions: diskGUID: type: string pattern: "^disk-[a-z]{24}$" - buildGUID: - type: string - pattern: "^build-[a-z]{24}$" packageGUID: type: string pattern: "^pkg-[a-z]{24}$" diff --git a/riocli/jsonschema/schemas/package-schema.yaml b/riocli/jsonschema/schemas/package-schema.yaml index a34d3f8f..3d9f8e94 100644 --- a/riocli/jsonschema/schemas/package-schema.yaml +++ b/riocli/jsonschema/schemas/package-schema.yaml @@ -120,7 +120,6 @@ definitions: default: docker enum: - docker - - build - preInstalled command: type: array @@ -163,17 +162,6 @@ definitions: "$ref": "#/definitions/secretDepends" required: - image - - properties: - type: - enum: - - build - build: - type: object - properties: - depends: - "$ref": "#/definitions/buildDepends" - required: - - depends - properties: type: enum: @@ -189,7 +177,6 @@ definitions: default: docker enum: - docker - - build command: type: string runAsBash: @@ -236,17 +223,6 @@ definitions: - depends required: - image - - properties: - type: - enum: - - build - build: - type: object - properties: - depends: - "$ref": "#/definitions/buildDepends" - required: - - depends portNumber: type: integer @@ -651,9 +627,6 @@ definitions: diskGUID: type: string pattern: "^disk-[a-z]{24}$" - buildGUID: - type: string - pattern: "^build-[a-z]{24}$" packageGUID: type: string pattern: "^pkg-[a-z]{24}$" @@ -677,15 +650,6 @@ definitions: - Never default: IfNotPresent - buildDepends: - properties: - kind: - const: build - default: build - nameOrGUID: - type: string - guid: - type: string packageDepends: properties: kind: diff --git a/riocli/jsonschema/schemas/primitives.yaml b/riocli/jsonschema/schemas/primitives.yaml index 9efe18d9..a1c1aac9 100644 --- a/riocli/jsonschema/schemas/primitives.yaml +++ b/riocli/jsonschema/schemas/primitives.yaml @@ -16,9 +16,6 @@ definitions: diskGUID: type: string pattern: "^disk-[a-z]{24}$" - buildGUID: - type: string - pattern: "^build-[a-z]{24}$" packageGUID: type: string pattern: "^pkg-[a-z]{24}$" @@ -32,13 +29,6 @@ definitions: type: string pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" - buildDepends: - properties: - kind: - const: build - default: build - nameOrGUID: - type: string packageDepends: properties: kind: diff --git a/riocli/package/inspect.py b/riocli/package/inspect.py index b0c89baf..8d24efe7 100644 --- a/riocli/package/inspect.py +++ b/riocli/package/inspect.py @@ -53,7 +53,6 @@ def make_package_inspectable(package: Package) -> dict: 'owner_project': package.ownerProject, 'tags': package.tags, 'plans': package.plans, - 'build_generation': package.buildGeneration, 'status': package.status, 'is_public': package.isPublic, 'category': package.category, diff --git a/riocli/package/model.py b/riocli/package/model.py index ec879a5d..93ab20b7 100644 --- a/riocli/package/model.py +++ b/riocli/package/model.py @@ -217,12 +217,6 @@ def _map_executable(self, exec): if exec.docker.get('imagePullPolicy'): exec_object.imagePullPolicy = exec.docker.imagePullPolicy - if exec.type == 'build': - exec_object.buildGUID = exec.build.depends.guid - # TODO verify this is right for secret? - # if exec.docker.pullSecret and exec.docker.pullSecret.depends and exec.docker.pullSecret.depends.guid: - # exec_object.secret = exec.docker.pullSecret.depends.guid - # TODO handle preinstalled return exec_object