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

feat(package): add support for nested docker images. #248

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ graphlib-backport = ">=1.0.3"
jinja2 = ">=3.0.1"
munch = ">=2.4.0"
pyyaml = ">=5.4.1"
rapyuta-io = ">=1.13.0"
rapyuta-io = ">=1.14.0"
tabulate = ">=0.8.0"
pyrfc3339 = ">=1.1"
directory-tree = ">=0.0.3.1"
Expand Down
268 changes: 130 additions & 138 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions riocli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@
pretty_traceback.install()
except ImportError:
pass # no need to fail because of missing dev dependency

# Patch `signal` to add SIGKILL for Windows. This is required for yaspin to work
# on windows.
from sys import platform

if platform.lower() == 'win32':
import signal
signal.SIGKILL = signal.SIGTERM
2 changes: 1 addition & 1 deletion riocli/jsonschema/schemas/package-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ definitions:
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}$"
imageName:
type: string
pattern: ^([a-zA-Z0-9])([\w.\-_]+((?::\d+|)(?=/[a-z0-9._-]+/[a-z0-9._-]+))|)(?:/|)([a-z0-9.\-_]+(?:/[a-z0-9.\-_]+|))(:([\w.\-_]{1,126})|)$
pattern: ^([a-zA-Z0-9])([\w.\-_]+((?::\d+|)(?=/[a-z0-9._-]+/[a-z0-9._-]+))|)(?:/|)([a-z0-9/.\-_]+(?:/[a-z0-9.\-_]+|))(:([\w.\-_]{1,126})|)$
imagePullPolicy:
type: string
enum:
Expand Down
4 changes: 3 additions & 1 deletion riocli/vpn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def get_host_name() -> str:
def is_linux() -> bool:
return platform.lower() == 'linux'

def is_windows() -> bool:
return platform.lower() == 'win32'

def is_curl_installed() -> bool:
return which('curl') is not None
Expand Down Expand Up @@ -131,7 +133,7 @@ def is_vpn_enabled_in_project(client: v2Client, project_guid: str) -> bool:

def get_command(cmd: str) -> str:
"""Returns an effective command to execute."""
if is_linux() and os.geteuid() == 0:
if is_windows() or (is_linux() and os.geteuid() == 0):
return cmd

return 'sudo {}'.format(cmd)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"python-dateutil>=2.8.2",
"pytz",
"pyyaml>=5.4.1",
"rapyuta-io>=1.13.0",
"rapyuta-io>=1.14.0",
"requests>=2.20.0",
"setuptools",
"six>=1.13.0",
Expand Down
Loading