poetry-plugin-ivcap 0.2.7__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ SERVICE_ID_OPT = "service-id"
11
11
  SERVICE_FILE_OPT = "service-file"
12
12
  SERVICE_TYPE_OPT = "service-type"
13
13
  PORT_OPT = "port"
14
+ POLICY_OPT = "policy"
14
15
 
15
16
  DOCKER_RUN_TEMPLATE_OPT = "docker-run-template"
16
17
  DOCKER_RUN_OPT = "docker-run-opts"
@@ -44,11 +44,11 @@ class DockerConfig(BaseModel):
44
44
  def from_run_template(self, data, args, line) -> List[any]:
45
45
  pdata = data.get("tool", {}).get(PLUGIN_NAME, {})
46
46
  template = pdata.get(DOCKER_RUN_TEMPLATE_OPT)
47
+ smode = pdata.get(SERVICE_TYPE_OPT)
48
+ if smode is None:
49
+ line(f"<error>ERROR: 'service-type' is not defined in [{PLUGIN_NAME}]</error>")
50
+ sys.exit(1)
47
51
  if template is None:
48
- smode = pdata.get(SERVICE_TYPE_OPT)
49
- if smode is None:
50
- line(f"<error>ERROR: 'service-type' is not defined in [{PLUGIN_NAME}]</error>")
51
- sys.exit(1)
52
52
  if smode == "lambda":
53
53
  template = DOCKER_LAMBDA_RUN_TEMPLATE
54
54
  elif smode == "batch":
@@ -11,7 +11,7 @@ import tempfile
11
11
  import uuid
12
12
  import humanize
13
13
 
14
- from .constants import DEF_POLICY, PLUGIN_NAME, SERVICE_FILE_OPT, SERVICE_ID_OPT
14
+ from .constants import DEF_POLICY, PLUGIN_NAME, POLICY_OPT, SERVICE_FILE_OPT, SERVICE_ID_OPT
15
15
 
16
16
  from .docker import docker_cfg, docker_build, docker_push
17
17
  from .util import command_exists, get_name, string_to_number
@@ -124,7 +124,7 @@ def create_service_id(data, is_silent, line):
124
124
  return f"urn:ivcap:service:{id}"
125
125
 
126
126
  def get_policy(data, line):
127
- policy = data.get("tool", {}).get(PLUGIN_NAME, {}).get("policy")
127
+ policy = data.get("tool", {}).get(PLUGIN_NAME, {}).get(POLICY_OPT)
128
128
  if not policy:
129
129
  policy = DEF_POLICY
130
130
  return policy
@@ -29,7 +29,8 @@ Supporting the development of services and tools for the IVCAP platform
29
29
  Available subcommands:
30
30
  run Run the service locally
31
31
  docker-build Build the docker image for this service
32
- docker-run Run the service's docker image locally
32
+ docker-run Run the service's docker image locally for testing
33
+ deploy Deploy the service to IVCAP (calls docker-publish, service-register and tool-register)
33
34
  docker-publish Publish the service's docker image to IVCAP
34
35
  service-register Register the service with IVCAP
35
36
  create-service-id Create a unique service ID for the service
@@ -49,7 +50,7 @@ Configurable options in pyproject.toml:
49
50
 
50
51
  # Optional
51
52
  {DOCKER_BUILD_TEMPLATE_OPT} = "docker buildx build -t #DOCKER_NAME# ."
52
- {DOCKER_RUN_TEMPLATE_OPT} = "docker run -rm -p #PORT#:#PORT#"
53
+ {DOCKER_RUN_TEMPLATE_OPT} = "docker run --rm -p #PORT#:#PORT# #DOCKER_NAME#"
53
54
  """
54
55
  arguments = [
55
56
  argument("subcommand", optional=True, description="Subcommand: run, deploy, etc."),
@@ -83,6 +84,10 @@ Configurable options in pyproject.toml:
83
84
  docker_build(data, self.line)
84
85
  elif sub == "docker-run":
85
86
  docker_run(data, args, self.line)
87
+ elif sub == "deploy" or sub == "publish":
88
+ docker_publish(data, self.line)
89
+ service_register(data, self.line)
90
+ tool_register(data, self.line)
86
91
  elif sub == "docker-publish":
87
92
  docker_publish(data, self.line)
88
93
  elif sub == "service-register":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: poetry-plugin-ivcap
3
- Version: 0.2.7
3
+ Version: 0.3.0
4
4
  Summary: A custom Poetry command for IVCAP deployments
5
5
  License: MIT
6
6
  Author: Max Ott
@@ -0,0 +1,11 @@
1
+ poetry_plugin_ivcap/constants.py,sha256=lW5K-iNdlYMXTdxRWlSQOfbqbU8PHfZ066JMcsM_jr0,1183
2
+ poetry_plugin_ivcap/docker.py,sha256=q86wl5Y-yzRdzeDI8RoBHx-ZWSJFvIVdzQzPdvnbkHs,7208
3
+ poetry_plugin_ivcap/ivcap.py,sha256=sheKyHnkDOd6MOEOF8OIELhvLut7eopJLqQQa_aYxoc,5742
4
+ poetry_plugin_ivcap/plugin.py,sha256=f1vadDtxgCZUZaBV4otkbWXf4wTMzRNKrLN2gTCF31k,5044
5
+ poetry_plugin_ivcap/util.py,sha256=bcjjbKoV_pAgeuC7Ws9XbJa3phFpNVyrRAlFJ1VubRg,3429
6
+ poetry_plugin_ivcap-0.3.0.dist-info/AUTHORS.md,sha256=s9xR4_HAHQgbNlj505LViebt5AtACQmhPf92aJvNYgg,88
7
+ poetry_plugin_ivcap-0.3.0.dist-info/LICENSE,sha256=dsQrDPPwW7iJs9pxahgJKDW8RNPf5FyXG70MFUlxcuk,1587
8
+ poetry_plugin_ivcap-0.3.0.dist-info/METADATA,sha256=pYFOVj7onIjC94XceqkBPPv0835EBumyVjOvC5bKdvc,3032
9
+ poetry_plugin_ivcap-0.3.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
10
+ poetry_plugin_ivcap-0.3.0.dist-info/entry_points.txt,sha256=3xagEFBkGgrVe8WyjmhlHLr4JDEWPN_W4DwxnIBWbNY,74
11
+ poetry_plugin_ivcap-0.3.0.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- poetry_plugin_ivcap/constants.py,sha256=SzPWjsVq3RHy5YWXM1rXxF1glCywxRdsKcTR2XJeOZU,1161
2
- poetry_plugin_ivcap/docker.py,sha256=T7yQDk39fm4_KTnA84UYcadyRt-94vAHy79BZplSt5s,7224
3
- poetry_plugin_ivcap/ivcap.py,sha256=xIabTtQVeFXMHBrq-dKSdAMxbKX5SsVlxTUbBfmgm84,5728
4
- poetry_plugin_ivcap/plugin.py,sha256=QIMurRBJE8cG7mVE9P46ckjF6Gjhku3l-U5H2KQo_Rg,4723
5
- poetry_plugin_ivcap/util.py,sha256=bcjjbKoV_pAgeuC7Ws9XbJa3phFpNVyrRAlFJ1VubRg,3429
6
- poetry_plugin_ivcap-0.2.7.dist-info/AUTHORS.md,sha256=s9xR4_HAHQgbNlj505LViebt5AtACQmhPf92aJvNYgg,88
7
- poetry_plugin_ivcap-0.2.7.dist-info/LICENSE,sha256=dsQrDPPwW7iJs9pxahgJKDW8RNPf5FyXG70MFUlxcuk,1587
8
- poetry_plugin_ivcap-0.2.7.dist-info/METADATA,sha256=a6L3AlCYxO_V6s7gu_qI3ROuKnP-IB3tZiDOcKRVrRc,3032
9
- poetry_plugin_ivcap-0.2.7.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
10
- poetry_plugin_ivcap-0.2.7.dist-info/entry_points.txt,sha256=3xagEFBkGgrVe8WyjmhlHLr4JDEWPN_W4DwxnIBWbNY,74
11
- poetry_plugin_ivcap-0.2.7.dist-info/RECORD,,