-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Isaac Orbit; ./repair utility; updated drivers and IS; bu…
…gfixes; more mapped folders; doc improvements; more new and improved bugs.
- Loading branch information
Showing
26 changed files
with
490 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,4 @@ WORKDIR /app | |
|
||
ENTRYPOINT [ "/bin/sh", "-c" ] | ||
|
||
ENV VERSION="v2.1.1" | ||
ENV VERSION="v2.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# region copyright | ||
# Copyright 2023 NVIDIA Corporation | ||
# | ||
# 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. | ||
# endregion | ||
|
||
|
||
import os | ||
import sys | ||
|
||
import click | ||
|
||
from src.python.config import c as config | ||
from src.python.utils import ( | ||
colorize_error, | ||
colorize_info, | ||
deployments, | ||
format_cloud_name, | ||
read_meta, | ||
read_tf_output, | ||
shell_command, | ||
) | ||
|
||
|
||
@click.command() | ||
@click.option( | ||
"--debug/--no-debug", | ||
default=False, | ||
show_default=True, | ||
) | ||
@click.argument( | ||
"deployment_name", | ||
required=True, | ||
type=click.Choice(deployments()), | ||
) | ||
@click.option( | ||
"--terraform/--no-terraform", | ||
"-t/-T", | ||
default=True, | ||
show_default=True, | ||
help="Run Teraform?", | ||
) | ||
@click.option( | ||
"--ansible/--no-ansible", | ||
"-a/-A", | ||
default=True, | ||
show_default=True, | ||
help="Run ansible?", | ||
) | ||
def main( | ||
debug: bool, | ||
deployment_name: str, | ||
terraform: bool, | ||
ansible: bool, | ||
): | ||
meta = read_meta(deployment_name, debug) | ||
cloud = read_tf_output(deployment_name, "cloud", verbose=debug) | ||
|
||
click.echo( | ||
colorize_info( | ||
f"* Repairing deployment '{deployment_name}' @ {format_cloud_name(cloud)}..." | ||
) | ||
) | ||
|
||
# run terraform | ||
if terraform: | ||
click.echo(colorize_info("* Re-running Terraform...")) | ||
shell_command( | ||
f"terraform init -upgrade -no-color -input=false {' > /dev/null' if not debug else ''}", | ||
cwd=f"{config['terraform_dir']}/{cloud}", | ||
verbose=debug, | ||
) | ||
shell_command( | ||
"terraform apply -auto-approve " | ||
+ f"-state={config['state_dir']}/{deployment_name}/.tfstate " | ||
+ f"-var-file={config['state_dir']}/{deployment_name}/.tfvars", | ||
cwd=f"{config['terraform_dir']}/{cloud}", | ||
verbose=debug, | ||
) | ||
|
||
# run ansible | ||
if ansible: | ||
click.echo(colorize_info("* Re-running Ansible...")) | ||
for app in ["isaac", "ovami"]: | ||
if meta["params"][app]: | ||
shell_command( | ||
f"ansible-playbook -i {config['state_dir']}/{deployment_name}/.inventory " | ||
+ f"{app}.yml {'-vv' if debug else ''}", | ||
cwd=f"{config['ansible_dir']}", | ||
verbose=debug, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
if os.path.exists("/.dockerenv"): | ||
# we're in docker, run command | ||
main() | ||
else: | ||
# we're outside, start docker container first | ||
shell_command(f"./run '{' '.join(sys.argv)}'", verbose=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Terminal=true | ||
Exec=/home/ubuntu/Desktop/orbit.sh | ||
Name=Isaac Orbit | ||
Icon=/home/ubuntu/Pictures/isaacsim-icon-shell.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# region copyright | ||
# Copyright 2023 NVIDIA Corporation | ||
# | ||
# 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. | ||
# endregion | ||
|
||
- name: Create directory for Orbit | ||
file: | ||
path: "{{ orbit_dir }}" | ||
state: directory | ||
owner: "{{ ansible_user }}" | ||
group: "{{ ansible_user }}" | ||
mode: 0755 | ||
|
||
- name: Upload Orbit setup files [1] | ||
template: src={{ item }} | ||
dest="{{ orbit_dir }}/{{ item }}" | ||
mode=755 | ||
owner=ubuntu | ||
group=ubuntu | ||
with_items: | ||
- orbit.dockerfile | ||
tags: __orbit_dockerfile | ||
|
||
- name: Upload Orbit setup files [2] | ||
template: src="{{ item }}" | ||
dest="/home/{{ ansible_user }}/Desktop" | ||
mode=755 | ||
owner=ubuntu | ||
group=ubuntu | ||
with_items: | ||
- orbit.sh | ||
|
||
- name: Desktop icon for Orbit | ||
copy: | ||
src: "{{ item }}" | ||
dest: "/home/{{ ansible_user }}/Desktop/{{ item }}" | ||
owner: "{{ ansible_user }}" | ||
group: "{{ ansible_user }}" | ||
mode: 0644 | ||
with_items: | ||
- orbit.desktop | ||
|
||
- name: Allow execution of desktop icon for Orbit | ||
shell: gio set "/home/{{ ansible_user }}/Desktop/{{ item }}" metadata::trusted true | ||
become_user: "{{ ansible_user }}" | ||
with_items: | ||
- orbit.desktop | ||
|
||
- name: Set permissions for Orbit desktop icon | ||
file: | ||
path: "/home/{{ ansible_user }}/Desktop/{{ item }}" | ||
mode: 0755 | ||
owner: "{{ ansible_user }}" | ||
group: "{{ ansible_user }}" | ||
with_items: | ||
- orbit.desktop | ||
|
||
- name: Build Orbit | ||
shell: docker build -t orbit -f "{{ orbit_dir }}/orbit.dockerfile" "{{ orbit_dir }}" | ||
become_user: "{{ ansible_user }}" | ||
tags: | ||
- skip_in_ovami |
Oops, something went wrong.