Skip to content

Commit eac13fa

Browse files
committed
fix: venv python path for different os
1 parent 3ab8341 commit eac13fa

File tree

4 files changed

+72
-15
lines changed

4 files changed

+72
-15
lines changed

community/modules/compute/htcondor-execute-point/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ limitations under the License.
249249
| <a name="input_metadata"></a> [metadata](#input\_metadata) | Metadata to add to HTCondor execute points | `map(string)` | `{}` | no |
250250
| <a name="input_min_idle"></a> [min\_idle](#input\_min\_idle) | Minimum number of idle VMs in the HTCondor pool (if pool reaches var.max\_size, this minimum is not guaranteed); set to ensure jobs beginning run more quickly. | `number` | `0` | no |
251251
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | Name prefix given to hostnames in this group of execute points; must be unique across all instances of this module | `string` | n/a | yes |
252-
| <a name="input_network_interfaces"></a> [network\_interfaces](#input\_network\_interfaces) | A list of network interfaces to attach to HTCondor execute point instances.<br/>Each network interface should have the following fields:<br/>- network: The self link of the network (required)<br/>- subnetwork: The self link of the subnetwork (optional)<br/>If not specified, will use var.network\_self\_link and var.subnetwork\_self\_link for backward compatibility. | <pre>list(object({<br/> network = string<br/> subnetwork = optional(string)<br/> }))</pre> | `[]` | no |
252+
| <a name="input_network_interfaces"></a> [network\_interfaces](#input\_network\_interfaces) | A list of network interfaces to attach to HTCondor execute point instances.<br/>Each network interface should have the following fields:<br/>- network (required): The self link of the network<br/>- subnetwork (optional): The self link of the subnetwork<br/>- nic\_type (optional): "GVNIC" or "VIRTIO\_NET"<br/>- stack\_type (optional): "IPV4\_ONLY" or "IPV4\_IPV6"<br/>- network\_ip (optional): Specific IP address to assign<br/>- queue\_count (optional): Queue count for multiqueue NIC<br/>- access\_config (optional): List of NAT config objects<br/>- ipv6\_access\_config (optional): List of IPv6 access config objects<br/>- alias\_ip\_range (optional): List of alias IP ranges<br/><br/>If the list is empty, the module will fall back to using var.network\_self\_link<br/>and var.subnetwork\_self\_link for backward compatibility. | <pre>list(object({<br/> network = string<br/> subnetwork = optional(string)<br/> nic_type = optional(string)<br/> stack_type = optional(string)<br/> network_ip = optional(string, "")<br/> queue_count = optional(number)<br/> access_config = optional(list(object({<br/> nat_ip = optional(string)<br/> network_tier = optional(string)<br/> })), [])<br/> ipv6_access_config = optional(list(object({<br/> network_tier = optional(string)<br/> })), [])<br/> alias_ip_range = optional(list(object({<br/> ip_cidr_range = string<br/> subnetwork_range_name = string<br/> })), [])<br/> }))</pre> | `[]` | no |
253253
| <a name="input_network_self_link"></a> [network\_self\_link](#input\_network\_self\_link) | The self link of the network HTCondor execute points will join | `string` | `"default"` | no |
254254
| <a name="input_network_storage"></a> [network\_storage](#input\_network\_storage) | An array of network attached storage mounts to be configured | <pre>list(object({<br/> server_ip = string,<br/> remote_mount = string,<br/> local_mount = string,<br/> fs_type = string,<br/> mount_options = string,<br/> client_install_runner = map(string)<br/> mount_runner = map(string)<br/> }))</pre> | `[]` | no |
255255
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which the HTCondor execute points will be created | `string` | n/a | yes |

community/modules/compute/htcondor-execute-point/main.tf

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,37 @@ locals {
117117
name_prefix = "${var.deployment_name}-${var.name_prefix}-ep"
118118

119119
# Handle backward compatibility for network configuration
120-
network_interfaces = length(var.network_interfaces) > 0 ? var.network_interfaces : [
121-
{
122-
network = var.network_self_link
123-
subnetwork = var.subnetwork_self_link
124-
}
125-
]
120+
# If var.network_interfaces is provided, use it directly.
121+
# Otherwise, fall back to the older vars var.network_self_link and var.subnetwork_self_link
122+
network_interfaces = (
123+
length(var.network_interfaces) > 0
124+
? [
125+
for ni in var.network_interfaces : {
126+
network = ni.network
127+
subnetwork = ni.subnetwork
128+
nic_type = ni.nic_type
129+
stack_type = ni.stack_type
130+
network_ip = ni.network_ip
131+
queue_count = ni.queue_count
132+
access_config = ni.access_config
133+
ipv6_access_config = ni.ipv6_access_config
134+
alias_ip_range = ni.alias_ip_range
135+
}
136+
]
137+
: [
138+
{
139+
network = var.network_self_link
140+
subnetwork = var.subnetwork_self_link
141+
nic_type = null
142+
stack_type = null
143+
network_ip = ""
144+
queue_count = null
145+
access_config = []
146+
ipv6_access_config = []
147+
alias_ip_range = []
148+
}
149+
]
150+
)
126151
}
127152

128153
data "google_compute_zones" "available" {
@@ -168,7 +193,13 @@ module "execute_point_instance_template" {
168193
network = network_interface.network
169194
subnetwork = network_interface.subnetwork
170195
subnetwork_project = var.project_id
171-
access_config = []
196+
nic_type = network_interface.nic_type
197+
stack_type = network_interface.stack_type
198+
network_ip = network_interface.network_ip
199+
queue_count = network_interface.queue_count
200+
access_config = network_interface.access_config
201+
ipv6_access_config = network_interface.ipv6_access_config
202+
alias_ip_range = network_interface.alias_ip_range
172203
}
173204
]
174205

community/modules/compute/htcondor-execute-point/variables.tf

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,40 @@ variable "network_interfaces" {
139139
description = <<-EOT
140140
A list of network interfaces to attach to HTCondor execute point instances.
141141
Each network interface should have the following fields:
142-
- network: The self link of the network (required)
143-
- subnetwork: The self link of the subnetwork (optional)
144-
If not specified, will use var.network_self_link and var.subnetwork_self_link for backward compatibility.
145-
EOT
142+
- network (required): The self link of the network
143+
- subnetwork (optional): The self link of the subnetwork
144+
- nic_type (optional): "GVNIC" or "VIRTIO_NET"
145+
- stack_type (optional): "IPV4_ONLY" or "IPV4_IPV6"
146+
- network_ip (optional): Specific IP address to assign
147+
- queue_count (optional): Queue count for multiqueue NIC
148+
- access_config (optional): List of NAT config objects
149+
- ipv6_access_config (optional): List of IPv6 access config objects
150+
- alias_ip_range (optional): List of alias IP ranges
151+
152+
If the list is empty, the module will fall back to using var.network_self_link
153+
and var.subnetwork_self_link for backward compatibility.
154+
EOT
155+
146156
type = list(object({
147-
network = string
148-
subnetwork = optional(string)
157+
network = string
158+
subnetwork = optional(string)
159+
nic_type = optional(string)
160+
stack_type = optional(string)
161+
network_ip = optional(string, "")
162+
queue_count = optional(number)
163+
access_config = optional(list(object({
164+
nat_ip = optional(string)
165+
network_tier = optional(string)
166+
})), [])
167+
ipv6_access_config = optional(list(object({
168+
network_tier = optional(string)
169+
})), [])
170+
alias_ip_range = optional(list(object({
171+
ip_cidr_range = string
172+
subnetwork_range_name = string
173+
})), [])
149174
}))
175+
150176
default = []
151177
}
152178

modules/scripts/startup-script/files/install_ansible.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ main() {
180180

181181
# Create pip virtual environment for Cluster Toolkit
182182
${python_path} -m venv "${venv_path}" --copies
183-
venv_python_path=${venv_path}/bin/python3
183+
venv_python_path="${venv_path}/bin/$(basename "${python_path}")"
184184

185185
# Upgrade pip if necessary
186186
pip_version=$(${venv_python_path} -m pip --version | sed -nr 's/^pip ([0-9]+\.[0-9]+).*$/\1/p')

0 commit comments

Comments
 (0)