質問するログイン新規登録

質問編集履歴

2

追記1

2020/05/24 03:24

投稿

coffee_like
coffee_like

スコア4

title CHANGED
File without changes
body CHANGED
@@ -145,4 +145,67 @@
145
145
  ローカルで`aws ecs start-task`コマンドを実行した場合、実行タスクに関するjsonが標準出力され、コマンドは終了します。
146
146
  特に問題はないと思うのですが、原因及び対応策がわからない状況です。
147
147
  アドバイスを頂けますと幸いです。
148
- 宜しくお願い致します。
148
+ 宜しくお願い致します。
149
+
150
+ ### 追記
151
+
152
+ 5/24
153
+
154
+ 失敗したジョブのコンテナにSSH接続し、コマンドを実行してみました。
155
+ 結果、問題なくコマンドを実行できました。
156
+ なぜ、CircleCIのジョブで実行すると完了しないのでしょうか?
157
+
158
+ 実行コマンド
159
+
160
+ `ssh -p xxxxx xxx.xxx.xxx.xxx`
161
+ `aws ecs start-task --cluster $AWS_ECS_ARN --container-instances $AWS_ECS_ContainerInstance_ID --task-definition task:3`
162
+
163
+ 実行結果
164
+
165
+ ```
166
+ circleci@12345hoge:~$ aws ecs start-task --cluster $AWS_ECS_ARN --container-instances $AWS_ECS_ContainerInstance_ID --task-definition task:3
167
+
168
+ {
169
+ "tasks": [
170
+ {
171
+ "attachments": [],
172
+ "availabilityZone": "ap-northeast-1c",
173
+ "clusterArn": "arn:aws:ecs:ap-northeast-1:1234567:cluster/hoge-Cruster",
174
+ "containerInstanceArn": "arn:aws:ecs:ap-northeast-1:1234567:container-instance/d4926f34-...",
175
+ "containers": [
176
+ {
177
+ "containerArn": "arn:aws:ecs:ap-northeast-1:1234567:container/359287c3-...",
178
+ "taskArn": "arn:aws:ecs:ap-northeast-1:1234567:task/bfa81a83-...",
179
+ "name": "task",
180
+ "image": "1234567.dkr.ecr.ap-northeast-1.amazonaws.com/task:b905234...",
181
+ "lastStatus": "PENDING",
182
+ "networkInterfaces": [],
183
+ "cpu": "0"
184
+ }
185
+ ],
186
+ "cpu": "256",
187
+ "createdAt": "2020-05-24T03:16:21.494000+00:00",
188
+ "desiredStatus": "RUNNING",
189
+ "group": "family:task",
190
+ "lastStatus": "PENDING",
191
+ "launchType": "EC2",
192
+ "memory": "256",
193
+ "overrides": {
194
+ "containerOverrides": [
195
+ {
196
+ "name": "taks"
197
+ }
198
+ ],
199
+ "inferenceAcceleratorOverrides": []
200
+ },
201
+ "tags": [],
202
+ "taskArn": "arn:aws:ecs:ap-northeast-1:1234567:task/bfa81a83-...",
203
+ "taskDefinitionArn": "arn:aws:ecs:ap-northeast-1:1234567:task-definition/task:3",
204
+ "version": 1
205
+ }
206
+ ],
207
+ "failures": []
208
+ }
209
+
210
+ circleci@12345hoge:~$
211
+ ```

1

タイトルを修正

2020/05/24 03:24

投稿

coffee_like
coffee_like

スコア4

title CHANGED
@@ -1,1 +1,1 @@
1
- [AWS CLI, CI] CircleCI で aws ecs start-task コマンドを使用した際にジョブが完了しない
1
+ [AWS CLI] CircleCI で aws ecs start-task コマンドを使用した際にジョブが完了しない
body CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  workflows:
39
39
  version: 2.1
40
- test_and_deploy:
40
+ run_task:
41
41
  jobs:
42
42
  - run_task
43
43
  ```