#!/bin/bash # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the # License. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and # limitations under the License. set -euo pipefail # Disclaimer: this env setup is for *internal use only*, custom actions scripts SHOULD NOT rely on it # this is kept solely for backward compatibility, variables defined by it *SHOULD NOT* be used source <%= node['cluster']['etc_dir'] %>/cfnconfig PCLUSTER_COOKBOOK_VIRTUALENV_PATH="<%= cookbook_virtualenv_path %>" PCLUSTER_SCRIPTS_DIR="<%= node['cluster']['scripts_dir'] %>" PCLUSTER_CONFIG_PATH="<%= node['cluster']['cluster_config_path'] %>" PCLUSTER_NODE_TYPE="<%= node['cluster']['node_type'] %>" PCLUSTER_SCHEDULER_QUEUE_NAME="<%= node['cluster']['scheduler_queue_name'] %>" PCLUSTER_STACK_NAME="<%= node['cluster']['stack_name'] %>" PCLUSTER_REGION="<%= node['cluster']['region'] %>" "${PCLUSTER_COOKBOOK_VIRTUALENV_PATH}"/bin/python \ "${PCLUSTER_SCRIPTS_DIR}/custom_action_executor.py" \ --region "${PCLUSTER_REGION}" \ --stack-name "${PCLUSTER_STACK_NAME}" \ --cluster-name "<%= @cluster_name %>" \ --node-type "${PCLUSTER_NODE_TYPE}" \ --queue-name "${PCLUSTER_SCHEDULER_QUEUE_NAME}" \ --cluster-configuration "${PCLUSTER_CONFIG_PATH}" \ --instance-id "<%= @instance_id %>" \ --instance-type "<%= @instance_type %>" \ --ip-address "<%= @ip_address %>" \ --hostname "<%= @hostname %>" \ --resource "<%= @compute_resource %>" \ --availability-zone "<%= @availability_zone %>" \ --scheduler "<%= @scheduler %>" \ --node-spec-file "<%= @node_spec_file %>" \ --verbose \ "$@"