GoogleCloudPlatform / marketplace-k8s-app-example

Apache License 2.0
23 stars 19 forks source link

make app/verify on nginx example fails due to missing timeout command on OSX #82

Closed moxious closed 6 years ago

moxious commented 6 years ago

Driver.sh uses the "timeout" command, part of GNU coreutils.

OSX doesn't come with coreutils, you can brew install coreutils but in this case it's under a different command name:

$ brew ls --verbose coreutils | grep timeout
/usr/local/Cellar/coreutils/8.29/bin/gtimeout

Work-around is to hand-hack the driver.sh file to use gtimeout instead of timeout.

Log of an example run that shows the failure:

INFO retrying
+ endpoint=http://nginx-1:8080
+ echo GET http://nginx-1:8080
GET http://nginx-1:8080
++ curl -o /dev/null -s -w '%{http_code}\n' http://nginx-1:8080
Expected http status code: 200
Actual http status code: 200
SUCCESS
+ http_status_code=200
+ echo 'Expected http status code: 200'
+ echo 'Actual http status code: 200'
+ [[ 200 == \2\0\0 ]]
+ echo SUCCESS

INFO Tester 'Pod/nginx-1-tester' succeeded
INFO Skip 'ConfigMap/nginx-1-test'
+ clean_iam_resources.sh
+ [[ -z nginx-1 ]]
+ [[ -z apptest-658fb675-e73a-4769-88a7-59f2990fe289 ]]
+ kubectl delete --namespace=apptest-658fb675-e73a-4769-88a7-59f2990fe289 --filename=-
serviceaccount "nginx-1-deployer-sa" deleted
rolebinding "nginx-1-deployer-rb" deleted
INFO Stop the application
application "nginx-1" deleted
INFO Wait for the applications to be deleted
/Users/x/hax/marketplace-k8s-app-tools/marketplace/driver/driver.sh: line 147: timeout: command not found
ERROR Some applications where not deleted
INFO Collecting events for namespace "apptest-658fb675-e73a-4769-88a7-59f2990fe289"
LAST SEEN   FIRST SEEN   COUNT     NAME                                        KIND         SUBOBJECT                   TYPE      REASON                  SOURCE                                        MESSAGE
1m          1m           1         nginx-1-5999cf6dd8-m9lqm.15394ff47619c3a9   Pod                                      Normal    Scheduled               default-scheduler                             Successfully assigned nginx-1-5999cf6dd8-m9lqm to gke-lab-default-pool-91a532ec-5293
1m          1m           1         nginx-1-5999cf6dd8-m9lqm.15394ff487aef6ae   Pod                                      Normal    SuccessfulMountVolume   kubelet, gke-lab-default-pool-91a532ec-5293   MountVolume.SetUp succeeded for volume "default-token-kjbj4" 
1m          1m           1         nginx-1-5999cf6dd8-m9lqm.15394ff4a0eb68b6   Pod          spec.containers{nginx}      Normal    Pulling                 kubelet, gke-lab-default-pool-91a532ec-5293   pulling image "gcr.io/neo4j-k8s-marketplace-public/nginx:latest"
52s         52s          1         nginx-1-5999cf6dd8-m9lqm.15394ff6f46dc099   Pod          spec.containers{nginx}      Normal    Pulled                  kubelet, gke-lab-default-pool-91a532ec-5293   Successfully pulled image "gcr.io/neo4j-k8s-marketplace-public/nginx:latest"
52s         52s          1         nginx-1-5999cf6dd8-m9lqm.15394ff6f7811aeb   Pod          spec.containers{nginx}      Normal    Created                 kubelet, gke-lab-default-pool-91a532ec-5293   Created container
52s         52s          1         nginx-1-5999cf6dd8-m9lqm.15394ff7014adda1   Pod          spec.containers{nginx}      Normal    Started                 kubelet, gke-lab-default-pool-91a532ec-5293   Started container
0s          0s           1         nginx-1-5999cf6dd8-m9lqm.15395003006486e6   Pod          spec.containers{nginx}      Normal    Killing                 kubelet, gke-lab-default-pool-91a532ec-5293   Killing container with id docker://nginx:Need to kill Pod
1m          1m           1         nginx-1-5999cf6dd8.15394ff474ae187f         ReplicaSet                               Normal    SuccessfulCreate        replicaset-controller                         Created pod: nginx-1-5999cf6dd8-m9lqm
1m          1m           1         nginx-1-deployer-fvk2z.15394ff326f29b71     Pod                                      Normal    Scheduled               default-scheduler                             Successfully assigned nginx-1-deployer-fvk2z to gke-lab-default-pool-91a532ec-1bwh
1m          1m           1         nginx-1-deployer-fvk2z.15394ff332052ad3     Pod                                      Normal    SuccessfulMountVolume   kubelet, gke-lab-default-pool-91a532ec-1bwh   MountVolume.SetUp succeeded for volume "config-volume" 
1m          1m           1         nginx-1-deployer-fvk2z.15394ff33407d4b8     Pod                                      Normal    SuccessfulMountVolume   kubelet, gke-lab-default-pool-91a532ec-1bwh   MountVolume.SetUp succeeded for volume "nginx-1-deployer-sa-token-p5tr9" 
1m          1m           1         nginx-1-deployer-fvk2z.15394ff350f7a8c7     Pod          spec.containers{deployer}   Normal    Pulling                 kubelet, gke-lab-default-pool-91a532ec-1bwh   pulling image "gcr.io/neo4j-k8s-marketplace-public/nginx/deployer:latest"
1m          1m           1         nginx-1-deployer-fvk2z.15394ff3cb35b403     Pod          spec.containers{deployer}   Normal    Pulled                  kubelet, gke-lab-default-pool-91a532ec-1bwh   Successfully pulled image "gcr.io/neo4j-k8s-marketplace-public/nginx/deployer:latest"
1m          1m           1         nginx-1-deployer-fvk2z.15394ff3ce9e8932     Pod          spec.containers{deployer}   Normal    Created                 kubelet, gke-lab-default-pool-91a532ec-1bwh   Created container
1m          1m           1         nginx-1-deployer-fvk2z.15394ff3d78b6b8f     Pod          spec.containers{deployer}   Normal    Started                 kubelet, gke-lab-default-pool-91a532ec-1bwh   Started container
1m          1m           1         nginx-1-deployer.15394ff3259a581a           Job                                      Normal    SuccessfulCreate        job-controller                                Created pod: nginx-1-deployer-fvk2z
9s          9s           1         nginx-1-tester.1539500104140ea1             Pod                                      Normal    Scheduled               default-scheduler                             Successfully assigned nginx-1-tester to gke-lab-default-pool-91a532ec-5293
8s          8s           1         nginx-1-tester.1539500112c01f2b             Pod                                      Normal    SuccessfulMountVolume   kubelet, gke-lab-default-pool-91a532ec-5293   MountVolume.SetUp succeeded for volume "config-volume" 
8s          8s           1         nginx-1-tester.15395001143acebb             Pod                                      Normal    SuccessfulMountVolume   kubelet, gke-lab-default-pool-91a532ec-5293   MountVolume.SetUp succeeded for volume "default-token-kjbj4" 
8s          8s           1         nginx-1-tester.153950012bdf69ee             Pod          spec.containers{tester}     Normal    Pulling                 kubelet, gke-lab-default-pool-91a532ec-5293   pulling image "gcr.io/neo4j-k8s-marketplace-public/nginx/tester:latest"
6s          6s           1         nginx-1-tester.1539500189c9e119             Pod          spec.containers{tester}     Normal    Pulled                  kubelet, gke-lab-default-pool-91a532ec-5293   Successfully pulled image "gcr.io/neo4j-k8s-marketplace-public/nginx/tester:latest"
6s          6s           1         nginx-1-tester.153950018cd55a61             Pod          spec.containers{tester}     Normal    Created                 kubelet, gke-lab-default-pool-91a532ec-5293   Created container
6s          6s           1         nginx-1-tester.1539500196438957             Pod          spec.containers{tester}     Normal    Started                 kubelet, gke-lab-default-pool-91a532ec-5293   Started container
4s          4s           1         nginx-1-tester.1539500211f9162e             Pod                                      Normal    SandboxChanged          kubelet, gke-lab-default-pool-91a532ec-5293   Pod sandbox changed, it will be killed and re-created.
1m          1m           1         nginx-1.15394ff4734d63db                    Deployment                               Normal    ScalingReplicaSet       deployment-controller                         Scaled up replica set nginx-1-5999cf6dd8 to 1
INFO Deleting namespace "apptest-658fb675-e73a-4769-88a7-59f2990fe289"
namespace "apptest-658fb675-e73a-4769-88a7-59f2990fe289" deleted
make: *** [app/verify] Error 1
moxious commented 6 years ago

Linking to this issue too, as it's related to driver.sh support for OSX https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/issues/133#issuecomment-398116837

huyhg commented 6 years ago

Thanks for the report! I'm closing issue in favor of the canonicalized https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/issues/133.

More generally, we're addressing all known OSX compatibility issues here!