pipen-cli-gbatch 0.0.4__py3-none-any.whl → 0.0.5__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.

Potentially problematic release.


This version of pipen-cli-gbatch might be problematic. Click here for more details.

@@ -79,7 +79,7 @@ from pipen.cli import CLIPlugin
79
79
  from pipen.scheduler import GbatchScheduler
80
80
  from pipen_poplog import LogsPopulator
81
81
 
82
- __version__ = "0.0.4"
82
+ __version__ = "0.0.5"
83
83
  __all__ = ("CliGbatchPlugin", "CliGbatchDaemon")
84
84
 
85
85
 
@@ -551,10 +551,10 @@ class XquteCliGbatchPlugin: # pragma: no cover
551
551
 
552
552
  def _clear_residues(self):
553
553
  """Clear any remaining log residues and display them."""
554
- if self.stdout_populator.residue:
554
+ if self.stdout_populator and self.stdout_populator.residue:
555
555
  logger.info(f"/STDOUT {self.stdout_populator.residue}")
556
556
  self.stdout_populator.residue = ""
557
- if self.stderr_populator.residue:
557
+ if self.stderr_populator and self.stderr_populator.residue:
558
558
  logger.error(f"/STDERR {self.stderr_populator.residue}")
559
559
  self.stderr_populator.residue = ""
560
560
 
@@ -595,15 +595,17 @@ class XquteCliGbatchPlugin: # pragma: no cover
595
595
  # Make it less frequent
596
596
  return
597
597
 
598
- stdout_lines = self.stdout_populator.populate()
599
- self.stdout_populator.increment_counter(len(stdout_lines))
600
- for line in stdout_lines:
601
- logger.info(f"/STDOUT {line}")
598
+ if self.stderr_populator:
599
+ stdout_lines = self.stdout_populator.populate()
600
+ self.stdout_populator.increment_counter(len(stdout_lines))
601
+ for line in stdout_lines:
602
+ logger.info(f"/STDOUT {line}")
602
603
 
603
- stderr_lines = self.stderr_populator.populate()
604
- self.stderr_populator.increment_counter(len(stderr_lines))
605
- for line in stderr_lines:
606
- logger.error(f"/STDERR {line}")
604
+ if self.stderr_populator:
605
+ stderr_lines = self.stderr_populator.populate()
606
+ self.stderr_populator.increment_counter(len(stderr_lines))
607
+ for line in stderr_lines:
608
+ logger.error(f"/STDERR {line}")
607
609
 
608
610
  @plugin.impl
609
611
  async def on_job_killed(self, scheduler, job):
@@ -802,6 +804,22 @@ class CliGbatchPlugin(CLIPlugin): # pragma: no cover
802
804
 
803
805
  setattr(known_parsed, key, val)
804
806
 
807
+ mount_as_cwd = getattr(known_parsed, "mount_as_cwd", None)
808
+ cwd = getattr(known_parsed, "cwd", None)
809
+ delattr(known_parsed, "mount_as_cwd")
810
+ if mount_as_cwd and cwd:
811
+ print(
812
+ "\033[1;4mError\033[0m: --mount-as-cwd and --cwd "
813
+ "cannot be used together.\n"
814
+ )
815
+ sys.exit(1)
816
+
817
+ mount = getattr(known_parsed, "mount", None) or []
818
+ if mount_as_cwd:
819
+ mount.append(f"{mount_as_cwd}:/mnt/disks/.cwd")
820
+ setattr(known_parsed, "mount", mount)
821
+ setattr(known_parsed, "cwd", "/mnt/disks/.cwd")
822
+
805
823
  return known_parsed
806
824
 
807
825
  def exec_command(self, args: Namespace) -> None:
@@ -128,6 +128,14 @@ You can also mount a file like `INFILE=gs://my-bucket/inputs/file.txt`. The pare
128
128
  and the file will be available at `/mnt/disks/INFILE/inputs/file.txt` in the VM. `$INFILE` can also be used in the command/script to refer to the mounted path.
129
129
  """
130
130
 
131
+ [[groups.arguments]]
132
+ flags = ["--mount-as-cwd"]
133
+ type = "str"
134
+ help = """The directory to mount as the current working directory of the command.
135
+ This is a shortcut for `--mount <cloudpath>:/mnt/disks/.cwd --cwd /mnt/disks/.cwd`.
136
+ The <cloudpath> must be a Google Storage Bucket path (gs://...).
137
+ """
138
+
131
139
  [[groups.arguments]]
132
140
  flags = ["--service-account"]
133
141
  type = "str"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pipen-cli-gbatch
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: A pipen cli plugin to run command via Google Cloud Batch
5
5
  License: MIT
6
6
  Author: pwwang
@@ -0,0 +1,6 @@
1
+ pipen_cli_gbatch/__init__.py,sha256=2LBMKrJyLLGIjYbquvMyerJYXoD9WJzYgrLEM9yNwEE,30280
2
+ pipen_cli_gbatch/daemon_args.toml,sha256=Yqty1vsNTUQKf411tFTExE1dGM5OHGYcI7ANQm0N-CQ,7170
3
+ pipen_cli_gbatch-0.0.5.dist-info/METADATA,sha256=tD81_KwxU8f-H-AFV7hAAPDj_H8ay7zdG-u93Ezgfmc,11301
4
+ pipen_cli_gbatch-0.0.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
5
+ pipen_cli_gbatch-0.0.5.dist-info/entry_points.txt,sha256=Z9NLeCpRo-rb8wss5mB5TBcG-_RbdlPA49b8Ma5pvQA,57
6
+ pipen_cli_gbatch-0.0.5.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- pipen_cli_gbatch/__init__.py,sha256=x5R1wU-TyXS_Z1EqJ1jWhFn66sKLt_fg8eyXtz9k7rg,29508
2
- pipen_cli_gbatch/daemon_args.toml,sha256=YzqLumFjIY8mRMzRt3M5D1fEjK93QvQJ0XynDnimPIo,6873
3
- pipen_cli_gbatch-0.0.4.dist-info/METADATA,sha256=5i6JjljULy5Km96zlHt0dcI97Wleq73yzYpakX5j8Zw,11301
4
- pipen_cli_gbatch-0.0.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
5
- pipen_cli_gbatch-0.0.4.dist-info/entry_points.txt,sha256=Z9NLeCpRo-rb8wss5mB5TBcG-_RbdlPA49b8Ma5pvQA,57
6
- pipen_cli_gbatch-0.0.4.dist-info/RECORD,,