diff --git a/agent/engine/engine_windows_integ_test.go b/agent/engine/engine_windows_integ_test.go index e18b3995ba..c0ef0b6190 100644 --- a/agent/engine/engine_windows_integ_test.go +++ b/agent/engine/engine_windows_integ_test.go @@ -58,7 +58,7 @@ func isDockerRunning() bool { return true } func createTestContainer() *apicontainer.Container { return &apicontainer.Container{ Name: "windows", - Image: "microsoft/windowsservercore:latest", + Image: "microsoft/windowsservercore", Essential: true, DesiredStatusUnsafe: apicontainerstatus.ContainerRunning, CPU: 512, @@ -96,7 +96,7 @@ func createTestHealthCheckTask(arn string) *apitask.Task { DesiredStatusUnsafe: apitaskstatus.TaskRunning, Containers: []*apicontainer.Container{createTestContainer()}, } - testTask.Containers[0].Image = "microsoft/nanoserver:latest" + testTask.Containers[0].Image = "microsoft/nanoserver" testTask.Containers[0].Name = "test-health-check" testTask.Containers[0].HealthCheckType = "docker" testTask.Containers[0].Command = []string{"powershell", "-command", "Start-Sleep -s 300"} diff --git a/agent/engine/ordering_integ_test.go b/agent/engine/ordering_integ_test.go index 39a1ce175e..c2ddda5c16 100644 --- a/agent/engine/ordering_integ_test.go +++ b/agent/engine/ordering_integ_test.go @@ -20,6 +20,7 @@ import ( apicontainer "github.com/aws/amazon-ecs-agent/agent/api/container" "github.com/aws/aws-sdk-go/aws" + "time" ) // TestDependencyHealthCheck is a happy-case integration test that considers a workflow with a HEALTHY dependency @@ -57,15 +58,21 @@ func TestDependencyHealthCheck(t *testing.T) { go taskEngine.AddTask(testTask) - // Both containers should start - verifyContainerRunningStateChange(t, taskEngine) - verifyContainerRunningStateChange(t, taskEngine) - verifyTaskIsRunning(stateChangeEvents, testTask) + finished := make(chan interface{}) + go func() { + // Both containers should start + verifyContainerRunningStateChange(t, taskEngine) + verifyContainerRunningStateChange(t, taskEngine) + verifyTaskIsRunning(stateChangeEvents, testTask) - // Task should stop all at once - verifyContainerStoppedStateChange(t, taskEngine) - verifyContainerStoppedStateChange(t, taskEngine) - verifyTaskIsStopped(stateChangeEvents, testTask) + // Task should stop all at once + verifyContainerStoppedStateChange(t, taskEngine) + verifyContainerStoppedStateChange(t, taskEngine) + verifyTaskIsStopped(stateChangeEvents, testTask) + close(finished) + }() + + waitFinished(t, finished, 90*time.Second) } @@ -103,17 +110,23 @@ func TestDependencyComplete(t *testing.T) { go taskEngine.AddTask(testTask) - // First container should run to completion and then exit - verifyContainerRunningStateChange(t, taskEngine) - verifyContainerStoppedStateChange(t, taskEngine) + finished := make(chan interface{}) - // Second container starts after the first stops, task becomes running - verifyContainerRunningStateChange(t, taskEngine) - verifyTaskIsRunning(stateChangeEvents, testTask) + go func() { + // First container should run to completion and then exit + verifyContainerRunningStateChange(t, taskEngine) + verifyContainerStoppedStateChange(t, taskEngine) - // Last container stops and then the task stops - verifyContainerStoppedStateChange(t, taskEngine) - verifyTaskIsStopped(stateChangeEvents, testTask) + // Second container starts after the first stops, task becomes running + verifyContainerRunningStateChange(t, taskEngine) + verifyTaskIsRunning(stateChangeEvents, testTask) + + // Last container stops and then the task stops + verifyContainerStoppedStateChange(t, taskEngine) + verifyTaskIsStopped(stateChangeEvents, testTask) + }() + + waitFinished(t, finished, 90*time.Second) } // TestDependencySuccess validates that the SUCCESS dependency condition will resolve when the child container exits @@ -150,17 +163,22 @@ func TestDependencySuccess(t *testing.T) { go taskEngine.AddTask(testTask) - // First container should run to completion - verifyContainerRunningStateChange(t, taskEngine) - verifyContainerStoppedStateChange(t, taskEngine) + finished := make(chan interface{}) + go func() { + // First container should run to completion + verifyContainerRunningStateChange(t, taskEngine) + verifyContainerStoppedStateChange(t, taskEngine) - // Second container starts after the first stops, task becomes running - verifyContainerRunningStateChange(t, taskEngine) - verifyTaskIsRunning(stateChangeEvents, testTask) + // Second container starts after the first stops, task becomes running + verifyContainerRunningStateChange(t, taskEngine) + verifyTaskIsRunning(stateChangeEvents, testTask) - // Last container stops and then the task stops - verifyContainerStoppedStateChange(t, taskEngine) - verifyTaskIsStopped(stateChangeEvents, testTask) + // Last container stops and then the task stops + verifyContainerStoppedStateChange(t, taskEngine) + verifyTaskIsStopped(stateChangeEvents, testTask) + }() + + waitFinished(t, finished, 90*time.Second) } // TestDependencySuccess validates that the SUCCESS dependency condition will fail when the child exits 1. This is a @@ -302,3 +320,14 @@ func TestDependencyHealthyTimeout(t *testing.T) { // task should transition to stopped verifyTaskIsStopped(stateChangeEvents, testTask) } + +func waitFinished(t *testing.T, finished <-chan interface{}, duration time.Duration) { + select { + case <-finished: + t.Log("Finished successfully.") + return + case <-time.After(90 * time.Second): + t.Error("timed out after: ", duration) + t.FailNow() + } +} diff --git a/agent/engine/ordering_integ_windows_test.go b/agent/engine/ordering_integ_windows_test.go index 7b236aea78..295a989eb7 100644 --- a/agent/engine/ordering_integ_windows_test.go +++ b/agent/engine/ordering_integ_windows_test.go @@ -20,5 +20,5 @@ const ( ) var ( - entryPointForOS = []string{"pwsh", "-c"} + entryPointForOS = []string{"powershell"} ) diff --git a/agent/functional_tests/testdata/taskdefinitions/awslogs-datetime-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/awslogs-datetime-windows/task-definition.json index f503fb3909..eb18daff64 100644 --- a/agent/functional_tests/testdata/taskdefinitions/awslogs-datetime-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/awslogs-datetime-windows/task-definition.json @@ -5,7 +5,7 @@ "memory": 512, "name": "awslogs-datetime-windows", "cpu": 1024, - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "entryPoint": ["powershell"], "command": ["echo", "\"May 01, 2017 19:00:01 ECS\nMay 01, 2017 19:00:04 Agent\nRunning\nin the instance\""], "logConfiguration": { diff --git a/agent/functional_tests/testdata/taskdefinitions/awslogs-multiline-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/awslogs-multiline-windows/task-definition.json index 415b57fe2f..e89eb61093 100644 --- a/agent/functional_tests/testdata/taskdefinitions/awslogs-multiline-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/awslogs-multiline-windows/task-definition.json @@ -5,7 +5,7 @@ "memory": 512, "name": "awslogs-multiline-windows", "cpu": 1024, - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "entryPoint": ["powershell"], "command": ["echo", "\"INFO: ECS Agent\nRunning\nINFO: Instance\""], "logConfiguration": { diff --git a/agent/functional_tests/testdata/taskdefinitions/awslogs-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/awslogs-windows/task-definition.json index 344211c1fd..66661f8a7c 100644 --- a/agent/functional_tests/testdata/taskdefinitions/awslogs-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/awslogs-windows/task-definition.json @@ -5,7 +5,7 @@ "memory": 512, "name": "awslogs", "cpu": 1024, - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "logConfiguration": { "logDriver": "awslogs", "options": { diff --git a/agent/functional_tests/testdata/taskdefinitions/cleanup-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/cleanup-windows/task-definition.json index 91ab3c575e..87c38348d1 100644 --- a/agent/functional_tests/testdata/taskdefinitions/cleanup-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/cleanup-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsftest-cleanup-windows", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "cleanup-windows", "cpu": 1024, "memory": 512, diff --git a/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator-windows/task-definition.json index 04862dbf8b..40e03b946c 100644 --- a/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator-windows/task-definition.json @@ -24,4 +24,4 @@ } }] } - \ No newline at end of file + diff --git a/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator/task-definition.json index 92e29ec757..ca136a9a8e 100644 --- a/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/container-metadata-file-validator/task-definition.json @@ -21,4 +21,4 @@ } }] } - \ No newline at end of file + diff --git a/agent/functional_tests/testdata/taskdefinitions/datavolume-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/datavolume-windows/task-definition.json index 533e1eed21..4d6175c19b 100644 --- a/agent/functional_tests/testdata/taskdefinitions/datavolume-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/datavolume-windows/task-definition.json @@ -5,7 +5,7 @@ "host": {} }], "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "cpu": 512, "memory": 256, @@ -15,7 +15,7 @@ }], "command": ["powershell", "-c", "while (1) { sleep 1; if (test-path \"C:/data/success\") { exit 42 }}; done"] }, { - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "dataSource", "cpu": 512, "memory": 256, @@ -25,7 +25,7 @@ }], "command": ["powershell", "-c", "New-Item -ItemType file C:/data/success"] }, { - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "data-volume-source", "cpu": 512, "memory": 256, diff --git a/agent/functional_tests/testdata/taskdefinitions/hostname-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/hostname-windows/task-definition.json index 891e029201..a1dd5c4cfc 100644 --- a/agent/functional_tests/testdata/taskdefinitions/hostname-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/hostname-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsftest-hostname", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "cpu": 1024, "memory": 512, diff --git a/agent/functional_tests/testdata/taskdefinitions/labels-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/labels-windows/task-definition.json index 3672df20ce..0672c2cb9a 100644 --- a/agent/functional_tests/testdata/taskdefinitions/labels-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/labels-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsftest-labels-windows", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "labeled", "cpu": 1024, "memory": 512, diff --git a/agent/functional_tests/testdata/taskdefinitions/logdriver-jsonfile-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/logdriver-jsonfile-windows/task-definition.json index 6e608d52c8..2bf70504d9 100644 --- a/agent/functional_tests/testdata/taskdefinitions/logdriver-jsonfile-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/logdriver-jsonfile-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsinteg-json-file-rollover", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "memory": 512, "cpu": 1024, diff --git a/agent/functional_tests/testdata/taskdefinitions/network-mode-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/network-mode-windows/task-definition.json index 6b381ceb38..a8835b9d40 100644 --- a/agent/functional_tests/testdata/taskdefinitions/network-mode-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/network-mode-windows/task-definition.json @@ -2,7 +2,7 @@ "family": "ecsftest-networkmode", "networkMode": "$$$$NETWORK_MODE$$$$", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "entryPoint": ["powershell"], "command": ["sleep", "60"], "name": "network-$$$$NETWORK_MODE$$$$", diff --git a/agent/functional_tests/testdata/taskdefinitions/oom-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/oom-windows/task-definition.json index caa1bd420c..52be1f3885 100644 --- a/agent/functional_tests/testdata/taskdefinitions/oom-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/oom-windows/task-definition.json @@ -5,8 +5,8 @@ "memory": 256, "name": "memory-overcommit", "cpu": 512, - "image": "amazon/amazon-ecs-windows-python:make", - "command": ["python", "-c", "import time; time.sleep(30); foo=' '*1024*1024*1024;"] + "image": "amazon/amazon-ecs-windows-telemetry-test:make", + "command": ["-concurrency", "10", "-memory", "1024"] }] } diff --git a/agent/functional_tests/testdata/taskdefinitions/savedstate-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/savedstate-windows/task-definition.json index ec831ba5ca..cb9fc368e9 100644 --- a/agent/functional_tests/testdata/taskdefinitions/savedstate-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/savedstate-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsftest-savedstate-windows", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "savedstate-windows", "cpu": 1024, "memory": 512, diff --git a/agent/functional_tests/testdata/taskdefinitions/secrets-environment-variables/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/secrets-environment-variables/task-definition.json index f98daf3a07..d366d64f21 100644 --- a/agent/functional_tests/testdata/taskdefinitions/secrets-environment-variables/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/secrets-environment-variables/task-definition.json @@ -17,4 +17,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/agent/functional_tests/testdata/taskdefinitions/simple-exit-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/simple-exit-windows/task-definition.json index b5dbec1a27..9d10d3647d 100644 --- a/agent/functional_tests/testdata/taskdefinitions/simple-exit-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/simple-exit-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsinteg-simple-exit-windows", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "cpu": 1024, "memory": 512, diff --git a/agent/functional_tests/testdata/taskdefinitions/task-elastic-inference/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/task-elastic-inference/task-definition.json index 61938d975d..4a9fa4b1b2 100644 --- a/agent/functional_tests/testdata/taskdefinitions/task-elastic-inference/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/task-elastic-inference/task-definition.json @@ -23,4 +23,4 @@ "deviceType": "eia1.medium" } ] -} \ No newline at end of file +} diff --git a/agent/functional_tests/testdata/taskdefinitions/task-local-vol-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/task-local-vol-windows/task-definition.json index 056b06c453..bb69a9f7be 100644 --- a/agent/functional_tests/testdata/taskdefinitions/task-local-vol-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/task-local-vol-windows/task-definition.json @@ -2,7 +2,7 @@ "family": "ecsftest-task-local-volume", "containerDefinitions": [ { - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "cpu": 512, "memory": 256, diff --git a/agent/functional_tests/testdata/taskdefinitions/task-local-vol/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/task-local-vol/task-definition.json index f83b54c495..045c670525 100644 --- a/agent/functional_tests/testdata/taskdefinitions/task-local-vol/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/task-local-vol/task-definition.json @@ -32,4 +32,4 @@ } } ] -} \ No newline at end of file +} diff --git a/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-read-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-read-windows/task-definition.json index 64e34d7bf3..19723e0cd2 100644 --- a/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-read-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-read-windows/task-definition.json @@ -3,7 +3,7 @@ "containerDefinitions": [ { "name": "task-shared-vol-read", - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "cpu": 512, "memory": 256, "essential": true, diff --git a/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-write-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-write-windows/task-definition.json index dae08a148b..a7aa9d288d 100644 --- a/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-write-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/task-shared-vol-write-windows/task-definition.json @@ -2,7 +2,7 @@ "family": "ecsftest-task-local-volume", "containerDefinitions": [ { - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "task-shared-vol-write-windows", "cpu": 512, "memory": 256, diff --git a/agent/functional_tests/testdata/taskdefinitions/working-dir-windows/task-definition.json b/agent/functional_tests/testdata/taskdefinitions/working-dir-windows/task-definition.json index 10c584389a..87ea6631c2 100644 --- a/agent/functional_tests/testdata/taskdefinitions/working-dir-windows/task-definition.json +++ b/agent/functional_tests/testdata/taskdefinitions/working-dir-windows/task-definition.json @@ -1,7 +1,7 @@ { "family": "ecsftest-working-dir-windows", "containerDefinitions": [{ - "image": "microsoft/windowsservercore:latest", + "image": "microsoft/windowsservercore", "name": "exit", "cpu": 1024, "memory": 512, diff --git a/misc/container-health-windows/windows.dockerfile b/misc/container-health-windows/windows.dockerfile index 83c1f8214c..3500f4ed52 100644 --- a/misc/container-health-windows/windows.dockerfile +++ b/misc/container-health-windows/windows.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/container-metadata-file-validator-windows/container-metadata-file-validator-windows.dockerfile b/misc/container-metadata-file-validator-windows/container-metadata-file-validator-windows.dockerfile index 68d01abdc6..3391340e61 100644 --- a/misc/container-metadata-file-validator-windows/container-metadata-file-validator-windows.dockerfile +++ b/misc/container-metadata-file-validator-windows/container-metadata-file-validator-windows.dockerfile @@ -11,6 +11,6 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/nanoserver:latest +FROM microsoft/windowsservercore ADD container-metadata-file-validator-windows.exe container-metadata-file-validator-windows.exe diff --git a/misc/container-metadata-file-validator-windows/setup-container-metadata-file-validator.ps1 b/misc/container-metadata-file-validator-windows/setup-container-metadata-file-validator.ps1 index bb9fada120..35c8ce1b1f 100644 --- a/misc/container-metadata-file-validator-windows/setup-container-metadata-file-validator.ps1 +++ b/misc/container-metadata-file-validator-windows/setup-container-metadata-file-validator.ps1 @@ -14,23 +14,7 @@ $oldPref = $ErrorActionPreference $ErrorActionPreference = 'Stop' -Invoke-Expression ${PSScriptRoot}\..\windows-deploy\hostsetup.ps1 - # Create amazon/amazon-ecs-container-metadata-file-validator-windows for tests -$buildscript = @" -mkdir C:\md -cp C:\ecs\container-metadata-file-validator-windows.go C:\md -go build -o C:\md\container-metadata-file-validator-windows.exe C:\md\container-metadata-file-validator-windows.go -cp C:\md\container-metadata-file-validator-windows.exe C:\ecs -"@ - -$buildimage="golang:1.7-nanoserver" -docker pull $buildimage - -docker run ` - --volume ${PSScriptRoot}:C:\ecs ` - $buildimage ` - powershell ${buildscript} - +Invoke-Expression "go build -o ${PSScriptRoot}\container-metadata-file-validator-windows.exe ${PSScriptRoot}\container-metadata-file-validator-windows.go" Invoke-Expression "docker build -t amazon/amazon-ecs-container-metadata-file-validator-windows --file ${PSScriptRoot}\container-metadata-file-validator-windows.dockerfile ${PSScriptRoot}" $ErrorActionPreference = $oldPref diff --git a/misc/image-cleanup-test-images/windows0.dockerfile b/misc/image-cleanup-test-images/windows0.dockerfile index 0c74c1e143..795a83eee6 100644 --- a/misc/image-cleanup-test-images/windows0.dockerfile +++ b/misc/image-cleanup-test-images/windows0.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows1.dockerfile b/misc/image-cleanup-test-images/windows1.dockerfile index 87ea24df41..0eea3f3b72 100644 --- a/misc/image-cleanup-test-images/windows1.dockerfile +++ b/misc/image-cleanup-test-images/windows1.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows2.dockerfile b/misc/image-cleanup-test-images/windows2.dockerfile index eecb823eac..402fc7a097 100644 --- a/misc/image-cleanup-test-images/windows2.dockerfile +++ b/misc/image-cleanup-test-images/windows2.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows3.dockerfile b/misc/image-cleanup-test-images/windows3.dockerfile index 0467862d05..1e46fd28a9 100644 --- a/misc/image-cleanup-test-images/windows3.dockerfile +++ b/misc/image-cleanup-test-images/windows3.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows4.dockerfile b/misc/image-cleanup-test-images/windows4.dockerfile index badb152dad..66687cefe5 100644 --- a/misc/image-cleanup-test-images/windows4.dockerfile +++ b/misc/image-cleanup-test-images/windows4.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows5.dockerfile b/misc/image-cleanup-test-images/windows5.dockerfile index 73e513aac2..9652868881 100644 --- a/misc/image-cleanup-test-images/windows5.dockerfile +++ b/misc/image-cleanup-test-images/windows5.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows6.dockerfile b/misc/image-cleanup-test-images/windows6.dockerfile index 2a925dbfc7..7e5f49366e 100644 --- a/misc/image-cleanup-test-images/windows6.dockerfile +++ b/misc/image-cleanup-test-images/windows6.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows7.dockerfile b/misc/image-cleanup-test-images/windows7.dockerfile index c42ca9c428..7b8115a08f 100644 --- a/misc/image-cleanup-test-images/windows7.dockerfile +++ b/misc/image-cleanup-test-images/windows7.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows8.dockerfile b/misc/image-cleanup-test-images/windows8.dockerfile index f87c436747..9c889a2291 100644 --- a/misc/image-cleanup-test-images/windows8.dockerfile +++ b/misc/image-cleanup-test-images/windows8.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/image-cleanup-test-images/windows9.dockerfile b/misc/image-cleanup-test-images/windows9.dockerfile index 8b243414b5..b9a069ca3b 100644 --- a/misc/image-cleanup-test-images/windows9.dockerfile +++ b/misc/image-cleanup-test-images/windows9.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/netkitten/build.ps1 b/misc/netkitten/build.ps1 index cf053df214..7b49f124fc 100644 --- a/misc/netkitten/build.ps1 +++ b/misc/netkitten/build.ps1 @@ -11,16 +11,5 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -$buildscript = @" -mkdir C:\nk -cp C:\netkitten\netkitten.go C:\nk -go build -o C:\nk\netkitten.exe C:\nk\netkitten.go -cp C:\nk\netkitten.exe C:\netkitten -"@ - -docker run ` - --volume ${PSScriptRoot}:C:\netkitten ` - golang:1.7-windowsservercore ` - powershell ${buildscript} - +Invoke-Expression "go build -o ${PSScriptRoot}\netkitten.exe ${PSScriptRoot}\netkitten.go" docker build -t "amazon/amazon-ecs-netkitten:make" -f "${PSScriptRoot}/windows.dockerfile" ${PSScriptRoot} diff --git a/misc/netkitten/windows.dockerfile b/misc/netkitten/windows.dockerfile index 67ed5844d4..83f0a4575e 100644 --- a/misc/netkitten/windows.dockerfile +++ b/misc/netkitten/windows.dockerfile @@ -10,10 +10,9 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. ADD netkitten.exe C:/netkitten.exe - ENTRYPOINT ["C:\\netkitten.exe"] diff --git a/misc/stats-windows/windows.dockerfile b/misc/stats-windows/windows.dockerfile index 402ad9a72f..d7888f802f 100644 --- a/misc/stats-windows/windows.dockerfile +++ b/misc/stats-windows/windows.dockerfile @@ -10,7 +10,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. diff --git a/misc/v3-task-endpoint-validator-windows/setup-v3-task-endpoint-validator.ps1 b/misc/v3-task-endpoint-validator-windows/setup-v3-task-endpoint-validator.ps1 index 4968934ee5..e3c349994b 100644 --- a/misc/v3-task-endpoint-validator-windows/setup-v3-task-endpoint-validator.ps1 +++ b/misc/v3-task-endpoint-validator-windows/setup-v3-task-endpoint-validator.ps1 @@ -14,23 +14,7 @@ $oldPref = $ErrorActionPreference $ErrorActionPreference = 'Stop' -Invoke-Expression ${PSScriptRoot}\..\windows-deploy\hostsetup.ps1 - # Create amazon/amazon-ecs-v3-task-endpoint-validator-windows for tests -$buildscript = @" -mkdir C:\V3 -cp C:\ecs\v3-task-endpoint-validator-windows.go C:\V3 -go build -o C:\V3\v3-task-endpoint-validator-windows.exe C:\V3\v3-task-endpoint-validator-windows.go -cp C:\V3\v3-task-endpoint-validator-windows.exe C:\ecs -"@ - -$buildimage="golang:1.7-windowsservercore" -docker pull $buildimage - -docker run ` - --volume ${PSScriptRoot}:C:\ecs ` - $buildimage ` - powershell ${buildscript} - +Invoke-Expression "go build -o ${PSScriptRoot}\v3-task-endpoint-validator-windows.exe ${PSScriptRoot}\v3-task-endpoint-validator-windows.go" Invoke-Expression "docker build -t amazon/amazon-ecs-v3-task-endpoint-validator-windows --file ${PSScriptRoot}\v3-task-endpoint-validator-windows.dockerfile ${PSScriptRoot}" $ErrorActionPreference = $oldPref diff --git a/misc/v3-task-endpoint-validator-windows/v3-task-endpoint-validator-windows.dockerfile b/misc/v3-task-endpoint-validator-windows/v3-task-endpoint-validator-windows.dockerfile index f5ce1cfc72..49282b83db 100644 --- a/misc/v3-task-endpoint-validator-windows/v3-task-endpoint-validator-windows.dockerfile +++ b/misc/v3-task-endpoint-validator-windows/v3-task-endpoint-validator-windows.dockerfile @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore ADD application.ps1 application.ps1 ADD v3-task-endpoint-validator-windows.exe v3-task-endpoint-validator-windows.exe diff --git a/misc/volumes-test/windows.dockerfile b/misc/volumes-test/windows.dockerfile index 1382115de0..50c55bb3ab 100644 --- a/misc/volumes-test/windows.dockerfile +++ b/misc/volumes-test/windows.dockerfile @@ -11,7 +11,7 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore MAINTAINER Amazon Web Services, Inc. SHELL ["powershell", "-command"] diff --git a/misc/windows-iam/Setup_Iam.ps1 b/misc/windows-iam/Setup_Iam.ps1 index 0d01945224..0597d301ce 100644 --- a/misc/windows-iam/Setup_Iam.ps1 +++ b/misc/windows-iam/Setup_Iam.ps1 @@ -16,23 +16,9 @@ $ErrorActionPreference = 'Stop' Invoke-Expression ${PSScriptRoot}\..\windows-deploy\hostsetup.ps1 -# Create amazon/amazon-ecs-iamrolecontainer for tests -$buildscript = @" -mkdir C:\IAM -cp C:\ecs\ec2.go C:\IAM -go get -u github.com/aws/aws-sdk-go -go get -u github.com/aws/aws-sdk-go/aws -go build -o C:\IAM\ec2.exe C:\IAM\ec2.go -cp C:\IAM\ec2.exe C:\ecs -"@ - -$buildimage="golang:1.7-windowsservercore" -docker pull $buildimage - -docker run ` - --volume ${PSScriptRoot}:C:\ecs ` - $buildimage ` - powershell ${buildscript} +Invoke-Expression "go get -u github.com/aws/aws-sdk-go" +Invoke-Expression "go get -u github.com/aws/aws-sdk-go/aws" +Invoke-Expression "go build -o ${PSScriptRoot}\ec2.exe ${PSScriptRoot}\ec2.go" Invoke-Expression "docker build -t amazon/amazon-ecs-iamrolecontainer --file ${PSScriptRoot}\iamroles.dockerfile ${PSScriptRoot}" $ErrorActionPreference = $oldPref diff --git a/misc/windows-iam/Setup_Iam_Images.ps1 b/misc/windows-iam/Setup_Iam_Images.ps1 index 310d43bd83..3e79319386 100644 --- a/misc/windows-iam/Setup_Iam_Images.ps1 +++ b/misc/windows-iam/Setup_Iam_Images.ps1 @@ -16,22 +16,10 @@ $ErrorActionPreference = 'Stop' # Create amazon/amazon-ecs-iamrolecontainer for tests -$buildscript = @" -mkdir C:\IAM -cp C:\ecs\ec2.go C:\IAM -go get -u github.com/aws/aws-sdk-go -go get -u github.com/aws/aws-sdk-go/aws -go build -o C:\IAM\ec2.exe C:\IAM\ec2.go -cp C:\IAM\ec2.exe C:\ecs -"@ +Invoke-Expression "go get -u github.com/aws/aws-sdk-go' +Invoke-Expression "go get -u github.com/aws/aws-sdk-go/aws" +Invoke-Expression "go build -o ${PSScriptRoot}\ec2.exe ${PSScriptRoot}\ec2.go" -$buildimage="golang:1.7-windowsservercore" -docker pull $buildimage - -docker run ` - --volume ${PSScriptRoot}:C:\ecs ` - $buildimage ` - powershell ${buildscript} Invoke-Expression "docker build -t amazon/amazon-ecs-iamrolecontainer --file ${PSScriptRoot}\iamroles.dockerfile ${PSScriptRoot}" $ErrorActionPreference = $oldPref diff --git a/misc/windows-iam/iamroles.dockerfile b/misc/windows-iam/iamroles.dockerfile index 11fc5875fd..5dbf4234d3 100644 --- a/misc/windows-iam/iamroles.dockerfile +++ b/misc/windows-iam/iamroles.dockerfile @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore ADD application.ps1 application.ps1 ADD ec2.exe ec2.exe diff --git a/misc/windows-listen80/Setup_Listen80.ps1 b/misc/windows-listen80/Setup_Listen80.ps1 index 4f5732486d..50cb5ee831 100644 --- a/misc/windows-listen80/Setup_Listen80.ps1 +++ b/misc/windows-listen80/Setup_Listen80.ps1 @@ -10,7 +10,9 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. +$oldPref = $ErrorActionPreference +$ErrorActionPreference = 'Stop' -docker pull microsoft/windowsservercore Invoke-Expression "go build -o ${PSScriptRoot}\listen80.exe ${PSScriptRoot}\listen80.go" Invoke-Expression "docker build -t amazon/amazon-ecs-listen80 --file ${PSScriptRoot}\listen80.dockerfile ${PSScriptRoot}" +$ErrorActionPreference = $oldPref diff --git a/misc/windows-listen80/listen80.dockerfile b/misc/windows-listen80/listen80.dockerfile index 7bad06d8cb..d544f13a80 100644 --- a/misc/windows-listen80/listen80.dockerfile +++ b/misc/windows-listen80/listen80.dockerfile @@ -11,5 +11,5 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM microsoft/windowsservercore:latest +FROM microsoft/windowsservercore ADD listen80.exe listen80.exe diff --git a/misc/windows-python/build.ps1 b/misc/windows-python/build.ps1 deleted file mode 100644 index 89a596e023..0000000000 --- a/misc/windows-python/build.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2017 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" file accompanying this file. This file is distributed -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -# express or implied. See the License for the specific language governing -# permissions and limitations under the License. - -docker pull python:3-windowsservercore-ltsc2016 -docker tag python:3-windowsservercore-ltsc2016 amazon/amazon-ecs-windows-python:make diff --git a/misc/windows-telemetry/build.ps1 b/misc/windows-telemetry/build.ps1 index 2c3b7143d1..ed00e3b846 100644 --- a/misc/windows-telemetry/build.ps1 +++ b/misc/windows-telemetry/build.ps1 @@ -11,4 +11,6 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. + +Invoke-Expression "go build -o ${PSScriptRoot}\stress.exe ${PSScriptRoot}\main.go" docker build -t "amazon/amazon-ecs-windows-telemetry-test:make" -f "${PSScriptRoot}/windows.dockerfile" ${PSScriptRoot} diff --git a/misc/windows-telemetry/windows.dockerfile b/misc/windows-telemetry/windows.dockerfile index f27985383a..a409398ba7 100644 --- a/misc/windows-telemetry/windows.dockerfile +++ b/misc/windows-telemetry/windows.dockerfile @@ -10,11 +10,8 @@ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either # express or implied. See the License for the specific language governing # permissions and limitations under the License. -FROM golang:nanoserver +FROM microsoft/windowsservercore -WORKDIR /gopath -COPY main.go . - -RUN go build -o stress main.go -ENTRYPOINT ["./stress"] +ADD stress.exe stress.exe +ENTRYPOINT ["./stress.exe"] CMD [ "-concurrency", "1000", "-memory", "1024"] diff --git a/scripts/run-functional-tests.ps1 b/scripts/run-functional-tests.ps1 index 382ad1d681..506716aede 100755 --- a/scripts/run-functional-tests.ps1 +++ b/scripts/run-functional-tests.ps1 @@ -14,7 +14,6 @@ Invoke-Expression "${PSScriptRoot}\..\misc\windows-iam\Setup_Iam.ps1" Invoke-Expression "${PSScriptRoot}\..\misc\windows-listen80\Setup_Listen80.ps1" Invoke-Expression "${PSScriptRoot}\..\misc\windows-telemetry\build.ps1" -Invoke-Expression "${PSScriptRoot}\..\misc\windows-python\build.ps1" Invoke-Expression "${PSScriptRoot}\..\misc\container-health-windows\build.ps1" Invoke-Expression "${PSScriptRoot}\..\misc\v3-task-endpoint-validator-windows\setup-v3-task-endpoint-validator.ps1" Invoke-Expression "${PSScriptRoot}\..\misc\container-metadata-file-validator-windows\setup-container-metadata-file-validator.ps1" diff --git a/scripts/run-integ-tests.ps1 b/scripts/run-integ-tests.ps1 index b99d2792c2..7d333eb779 100755 --- a/scripts/run-integ-tests.ps1 +++ b/scripts/run-integ-tests.ps1 @@ -22,7 +22,7 @@ Invoke-Expression "${PSScriptRoot}\..\misc\netkitten\build.ps1" $cwd = (pwd).Path try { cd "${PSScriptRoot}" - go test -race -tags integration -timeout=25m -v ../agent/engine ../agent/stats ../agent/app + go test -race -tags integration -timeout=35m -v ../agent/engine ../agent/stats ../agent/app $testsExitCode = $LastExitCode } finally { cd "$cwd"