|
71 | 71 | IMAGE_PULL_POLICY="IfNotPresent" |
72 | 72 | INIT_CONTAINER_IMAGE="odpf/optimus:dev" |
73 | 73 | INIT_CONTAINER_ENTRYPOINT="/opt/entrypoint_init_container.sh" |
74 | | - |
75 | | -defget_entrypoint_cmd(plugin_entrypoint): |
76 | | -path_config=JOB_DIR+"/in/.env" |
77 | | -path_secret=JOB_DIR+"/in/.secret" |
78 | | -entrypoint="set -o allexport; source {path_config}; set +o allexport; cat {path_config}; ".format(path_config=path_config) |
79 | | -entrypoint+="set -o allexport; source {path_secret}; set +o allexport; ".format(path_secret=path_secret) |
80 | | -returnentrypoint+plugin_entrypoint |
| 74 | +EXEC_CONTAINER_ENTRYPOINT=JOB_DIR+"/exec_entrypoint.sh" |
81 | 75 |
|
82 | 76 | volume=k8s.V1Volume( |
83 | 77 | name='asset-volume', |
@@ -119,8 +113,8 @@ def get_entrypoint_cmd(plugin_entrypoint): |
119 | 113 | image_pull_policy=IMAGE_PULL_POLICY, |
120 | 114 | namespace=conf.get('kubernetes','namespace',fallback="default"), |
121 | 115 | image="example.io/namespace/bq2bq-executor:latest", |
122 | | -cmds=["/bin/sh"], |
123 | | -arguments=["-c",get_entrypoint_cmd("""python3 /opt/bumblebee/main.py """)], |
| 116 | +cmds=[EXEC_CONTAINER_ENTRYPOINT], |
| 117 | +arguments=["""python3 /opt/bumblebee/main.py """],# space inside the quote is required |
124 | 118 | name="bq-bq", |
125 | 119 | task_id="bq-bq", |
126 | 120 | get_logs=True, |
@@ -156,8 +150,8 @@ def get_entrypoint_cmd(plugin_entrypoint): |
156 | 150 | image_pull_policy=IMAGE_PULL_POLICY, |
157 | 151 | namespace=conf.get('kubernetes','namespace',fallback="default"), |
158 | 152 | image="example.io/namespace/transporter-executor:latest", |
159 | | -cmds=["/bin/sh"], |
160 | | -arguments=["-c",get_entrypoint_cmd("""java -cp /opt/transporter/transporter.jar:/opt/transporter/jolokia-jvm-agent.jar -javaagent:jolokia-jvm-agent.jar=port=7777,host=0.0.0.0 com.gojek.transporter.Main """)], |
| 153 | +cmds=[EXEC_CONTAINER_ENTRYPOINT], |
| 154 | +arguments=["""java -cp /opt/transporter/transporter.jar:/opt/transporter/jolokia-jvm-agent.jar -javaagent:jolokia-jvm-agent.jar=port=7777,host=0.0.0.0 com.gojek.transporter.Main """],# space inside the quote is required |
161 | 155 | name="hook_transporter", |
162 | 156 | task_id="hook_transporter", |
163 | 157 | get_logs=True, |
@@ -189,8 +183,8 @@ def get_entrypoint_cmd(plugin_entrypoint): |
189 | 183 | image_pull_policy=IMAGE_PULL_POLICY, |
190 | 184 | namespace=conf.get('kubernetes','namespace',fallback="default"), |
191 | 185 | image="example.io/namespace/predator-image:latest", |
192 | | -cmds=["/bin/sh"], |
193 | | -arguments=["-c",get_entrypoint_cmd("""predator ${SUB_COMMAND} -s ${PREDATOR_URL} -u "${BQ_PROJECT}.${BQ_DATASET}.${BQ_TABLE}" """)], |
| 186 | +cmds=[EXEC_CONTAINER_ENTRYPOINT], |
| 187 | +arguments=["""predator ${SUB_COMMAND} -s ${PREDATOR_URL} -u "${BQ_PROJECT}.${BQ_DATASET}.${BQ_TABLE}" """],# space inside the quote is required |
194 | 188 | name="hook_predator", |
195 | 189 | task_id="hook_predator", |
196 | 190 | get_logs=True, |
@@ -222,8 +216,8 @@ def get_entrypoint_cmd(plugin_entrypoint): |
222 | 216 | image_pull_policy=IMAGE_PULL_POLICY, |
223 | 217 | namespace=conf.get('kubernetes','namespace',fallback="default"), |
224 | 218 | image="example.io/namespace/failure-hook-image:latest", |
225 | | -cmds=["/bin/sh"], |
226 | | -arguments=["-c",get_entrypoint_cmd("""sleep 5 """)], |
| 219 | +cmds=[EXEC_CONTAINER_ENTRYPOINT], |
| 220 | +arguments=["""sleep 5 """],# space inside the quote is required |
227 | 221 | name="hook_failureHook", |
228 | 222 | task_id="hook_failureHook", |
229 | 223 | get_logs=True, |
|