Skip to content

Commit

Permalink
Keep support for SPARK_PORTS, used in CentOS7 systemuser image
Browse files Browse the repository at this point in the history
SPARK_PORTS is consumed by the port allocator version that runs
in the systemuser CentOS7 image. We need to keep compatibility
with such version for as long as we support the CentOS7 image.
  • Loading branch information
etejedor committed Dec 21, 2023
1 parent 150b037 commit bd00ef8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion swan-cern/files/swan_computing_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,13 @@ async def _open_ports(self, num_ports):
await self.spawner.api.replace_namespaced_service(computing_ports_service, swan_container_namespace, service)

# Add ports env for computing integrations
# Keep old SPARK_PORTS variable name for as long as we support the CentOS7 image, since the port
# allocator version of such image expects a variable with that name
ports_var_name = 'COMPUTING_PORTS' if 'swan-cern' in notebook_container.image else 'SPARK_PORTS'
notebook_container.env = self._add_or_replace_by_name(
notebook_container.env,
V1EnvVar(
name='COMPUTING_PORTS',
name=ports_var_name,
value=','.join(ports)
)
)
Expand Down

0 comments on commit bd00ef8

Please sign in to comment.