comparison gcp_batch_netcat.py @ 10:cdfa2e1a7ef4 draft

planemo upload for repository https://github.com/afgane/gcp_batch_netcat commit 4af8133734db9edb3cb94326a82cdaa484e96482-dirty
author enis
date Tue, 12 Aug 2025 16:22:41 +0000
parents 3fd12035e6c9
children fe0bf22037a5
comparison
equal deleted inserted replaced
9:3fd12035e6c9 10:cdfa2e1a7ef4
87 echo "=== GCP Batch NFS Connectivity Test ===" 87 echo "=== GCP Batch NFS Connectivity Test ==="
88 echo "Target: {target_host}:{target_port}" 88 echo "Target: {target_host}:{target_port}"
89 echo "Timestamp: $(date)" 89 echo "Timestamp: $(date)"
90 echo "Container hostname: $(hostname)" 90 echo "Container hostname: $(hostname)"
91 echo "Host VM Image: galaxy-k8s-boot-v2025-08-10" 91 echo "Host VM Image: galaxy-k8s-boot-v2025-08-10"
92 echo "Container Image: afgane/gcp-batch-netcat:0.2.0" 92 echo "Container Image: afgane/gcp-batch-netcat:0.3.0"
93 echo "" 93 echo ""
94 94
95 # Basic system info 95 # Basic system info
96 echo "=== System Information ===" 96 echo "=== System Information ==="
97 echo "OS Release:" 97 echo "OS Release:"
305 305
306 # Define the job using the Python client library objects 306 # Define the job using the Python client library objects
307 logger.info("Building job specification...") 307 logger.info("Building job specification...")
308 runnable = batch_v1.Runnable() 308 runnable = batch_v1.Runnable()
309 runnable.container = batch_v1.Runnable.Container() 309 runnable.container = batch_v1.Runnable.Container()
310 runnable.container.image_uri = "afgane/gcp-batch-netcat:0.2.0" 310 runnable.container.image_uri = "afgane/gcp-batch-netcat:0.3.0"
311 311
312 # Bind mount /cvmfs from the host VM (which has CVMFS client) into the container 312 # Bind mount /cvmfs from the host VM (which has CVMFS client) into the container
313 cvmfs_volume = batch_v1.Volume() 313 # Use the docker-style volume syntax for bind mounting host paths
314 cvmfs_volume.host_path = "/cvmfs" 314 runnable.container.volumes = ["/cvmfs:/cvmfs:ro"]
315 cvmfs_volume.mount_path = "/cvmfs"
316 runnable.container.volumes = [cvmfs_volume]
317 315
318 runnable.container.entrypoint = "/bin/bash" 316 runnable.container.entrypoint = "/bin/bash"
319 runnable.container.commands = ["-c", test_script] 317 runnable.container.commands = ["-c", test_script]
320 logger.debug(f"Container config: image={runnable.container.image_uri}, with /cvmfs bind mount from custom VM") 318 logger.debug(f"Container config: image={runnable.container.image_uri}, with /cvmfs bind mount from custom VM")
321 319
348 instance_policy.boot_disk = batch_v1.AllocationPolicy.Disk() 346 instance_policy.boot_disk = batch_v1.AllocationPolicy.Disk()
349 instance_policy.boot_disk.image = f"projects/{project_id}/global/images/galaxy-k8s-boot-v2025-08-10" 347 instance_policy.boot_disk.image = f"projects/{project_id}/global/images/galaxy-k8s-boot-v2025-08-10"
350 instance_policy.boot_disk.size_gb = 99 348 instance_policy.boot_disk.size_gb = 99
351 logger.debug(f"Using custom VM image: {instance_policy.boot_disk.image}") 349 logger.debug(f"Using custom VM image: {instance_policy.boot_disk.image}")
352 350
351 # Wrap the instance policy in InstancePolicyOrTemplate
352 instance_policy_or_template = batch_v1.AllocationPolicy.InstancePolicyOrTemplate()
353 instance_policy_or_template.policy = instance_policy
354
353 allocation_policy = batch_v1.AllocationPolicy() 355 allocation_policy = batch_v1.AllocationPolicy()
354 allocation_policy.network = network_policy 356 allocation_policy.network = network_policy
355 allocation_policy.instances = [instance_policy] 357 allocation_policy.instances = [instance_policy_or_template]
356 358
357 job = batch_v1.Job() 359 job = batch_v1.Job()
358 job.task_groups = [task_group] 360 job.task_groups = [task_group]
359 job.allocation_policy = allocation_policy 361 job.allocation_policy = allocation_policy
360 job.logs_policy = batch_v1.LogsPolicy() 362 job.logs_policy = batch_v1.LogsPolicy()