GithubHelp home page GithubHelp logo

Comments (11)

nkubala avatar nkubala commented on June 2, 2024

Thanks for reporting @goffinf. I just opened #40 which removes the intermediate images generated in each test run, I believe this is the issue you're referring to.

from container-structure-test.

goffinf avatar goffinf commented on June 2, 2024

Hey Nick,

yeah probably. It might just be semantics, but I meant the containers that are used to run the tests that are left behind when the run completes. For example after I ran a few tests tonight this is what I had laying around afterwards (which would be nice to clean up)

[vagrant@terraform-linux-test terraform]$ docker container ls -a
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                      PORTS               NAMES
3954955b3a10        terraform-aws:0.10.8   "entrypoint.sh NOO..."   8 minutes ago       Created                                         angry_sammet
41e3f69b3389        terraform-aws:0.10.8   "entrypoint.sh NOO..."   8 minutes ago       Created                                         wonderful_cori
07419a00dd3b        terraform-aws:0.10.8   "entrypoint.sh NOO..."   8 minutes ago       Created                                         priceless_bardeen
58c214979ed2        terraform-aws:0.10.8   "entrypoint.sh doc..."   8 minutes ago       Exited (0) 8 minutes ago                        sleepy_noether
e55903f10c2b        terraform-aws:0.10.8   "entrypoint.sh ran..."   8 minutes ago       Exited (0) 8 minutes ago                        elegant_varahamihira
d173fb0edd24        terraform-aws:0.10.8   "entrypoint.sh ter..."   8 minutes ago       Exited (0) 8 minutes ago                        sharp_swirles
441142750c67        terraform-aws:0.10.8   "entrypoint.sh doc..."   9 minutes ago       Exited (0) 9 minutes ago                        amazing_allen
6bd5ba4562bd        terraform-aws:0.10.8   "entrypoint.sh ran..."   9 minutes ago       Exited (0) 9 minutes ago                        condescending_swartz
c1c2e26a7061        terraform-aws:0.10.8   "entrypoint.sh ter..."   9 minutes ago       Exited (0) 9 minutes ago                        vigilant_feynman
b46379c57cae        terraform-aws:0.10.8   "entrypoint.sh doc..."   34 minutes ago      Exited (0) 34 minutes ago                       loving_kilby
b67371c31501        terraform-aws:0.10.8   "entrypoint.sh ran..."   34 minutes ago      Exited (0) 34 minutes ago                       frosty_shaw
302ce0658a8f        terraform-aws:0.10.8   "entrypoint.sh ter..."   34 minutes ago      Exited (0) 34 minutes ago                       zen_bassi

from container-structure-test.

nkubala avatar nkubala commented on June 2, 2024

Ah ok I thought you might have been conflating the terms, but no this is definitely a different issue (my PR still fixes a bug but not the same as this). We already do remove the intermediate containers (#18), so either you're on an old version or you're running into a corner case that's causing yours to stick around. Could you tell me what version of the tool you're running? Maybe provide me with an image/test YAML to reproduce the issue on?

from container-structure-test.

goffinf avatar goffinf commented on June 2, 2024

Hey Nick,

not sure about what the actual version # is, I mentioned in one of the other issues that I am using the binary from the link in the github repo, where it says ' ... Download the latest binary release here'... so this one ...

https://storage.googleapis.com/container-structure-test/latest/container-structure-test

A simple example using busybox

[vagrant@terraform-linux-test busybox]$ cat file_tests.yaml
schemaVersion: "2.0.0"

globalEnvVars:
  - key: "VIRTUAL_ENV"
    value: "/env"
  - key: "PATH"
    value: "/env/bin:$PATH"

fileExistenceTests:

# check that the apt-packages text file exists and has the correct permissions
  - name: 'resolve-conf-present'
    path: '/etc/resolv.conf'
    shouldExist: true

No containers present before starting the test ..

[vagrant@terraform-linux-test busybox]$ docker container ls -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Run the test ...

[vagrant@terraform-linux-test busybox]$ container-structure-test -test.v -image busybox:latest file_tests.yaml
Using driver docker
=== RUN   TestAll
2018/01/22 21:37:37 Running tests for file file_tests.yaml
=== RUN   TestAll/File_Existence_Test:_resolve-conf-present
=== RUN   TestAll/Metadata_Test
--- PASS: TestAll (0.02s)
    --- PASS: TestAll/File_Existence_Test:_resolve-conf-present (0.02s)
    --- PASS: TestAll/Metadata_Test (0.00s)
        structure_test.go:46: Total tests run: 2
PASS

NOTE: Not sure why Metadata_Test was run, there wasn't any defined in the yaml (although these is a separate file in this directory that has a Metadata_Test but it would have failed if run) ???

Anyway, AFTER the test was run we have a container left behind ...

[vagrant@terraform-linux-test busybox]$ docker container ls -a --no-trunc
CONTAINER ID                                                       IMAGE               COMMAND                     CREATED             STATUS              PORTS               NAMES
6c7ed7b5aa9a34c067c65b5753e595edd4a9bef0e145ec7f25a79fc0e1f4fb41   busybox:latest      "NOOP_COMMAND_DO_NOT_RUN"   25 seconds ago      Created                                 distracted_euler

from container-structure-test.

nkubala avatar nkubala commented on June 2, 2024

Hey Fraser,

I was able to reproduce your issue, and it should be fixed with the PR referenced in this issue. Thanks again for reporting, and let me know if you run into any more issues!

from container-structure-test.

Jeoffreybauvin avatar Jeoffreybauvin commented on June 2, 2024

Hi @nkubala

Is this issue fixed ?

I still have some temporary containers (with the latest version) :

# docker ps -a
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS               NAMES
72e4115f3b0d        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 adoring_jang
c384b1db97ae        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 silly_noether
52241b6857b9        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 infallible_hoover
e44c3c50d040        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 quizzical_ardinghelli
94965ac0a0a9        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 gallant_clarke
b32f90ae9cea        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 distracted_pike
2f0eaf7d9baf        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 practical_leavitt
9e5c5235626b        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 jovial_goldstine
58e3da35ef0d        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 mystifying_swirles
740ad4c271e2        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 focused_goodall
f4621dc0dcfa        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 happy_swanson
a01f1b33ae31        debian:jessie-build   "NOOP_COMMAND_DO_NOT…"   About an hour ago   Created                                 objective_leakey

from container-structure-test.

nkubala avatar nkubala commented on June 2, 2024

@Jeoffreybauvin hmm, I thought the fix I merged here fixed the issue but it's possible I missed a case. Could you give me the full command you're running to reproduce this? Also the binary version you're running?

from container-structure-test.

Jeoffreybauvin avatar Jeoffreybauvin commented on June 2, 2024

@nkubala the full command :

docker run --rm -i -v ${PWD}/tmp:/tmp/container-structure-test/ -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/src gcr.io/gcp-runtimes/container-structure-test:latest test --image "debian:jessie" --config /src/test.yaml

The version : 1.2.1

And just after this run :

~ docker ps -a
CONTAINER ID        IMAGE                                                         COMMAND                  CREATED              STATUS                    PORTS               NAMES
a7f6b743e0a5        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       vibrant_wilson
73958b255fde        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       suspicious_lalande
4cb3b9a13294        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       laughing_euclid
a7aa1a4fec51        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       vibrant_galileo
a81e686ae087        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       flamboyant_goldberg
53ac3776d325        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       silly_curran
af58d7a91b82        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       condescending_sammet
6eddb3fcb2cc        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       ecstatic_pare
4707451c30d1        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       laughing_booth
1d66a20f7e1d        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       admiring_stonebraker
ee5ae6da20d4        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       boring_jennings
94b2d41bbb54        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       blissful_swanson
45631d95aabb        debian:jessie                    "NOOP_COMMAND_DO_N..."   About a minute ago   Created                                       flamboyant_kalam

from container-structure-test.

nkubala avatar nkubala commented on June 2, 2024

@Jeoffreybauvin I did fix this a while ago, but then I rebroke it recently :)

#140

from container-structure-test.

nkubala avatar nkubala commented on June 2, 2024

As an aside, I see you're running docker in docker to run your tests....you shouldn't have to do this :) if you're doing this because you're running on OSX, as of version 1.2.0 we're publishing an OSX binary so you can use that. If not, I'd love to hear your use case so I can help you work around that.

from container-structure-test.

Jeoffreybauvin avatar Jeoffreybauvin commented on June 2, 2024

@nkubala I'm not running on OSX :). I'm Using Atlassian Bamboo with remote Linux agents with Docker installed.

I want my remote agents to be as "light" as possible, so I need to run container-structure-test in a Docker container. It's working well, besides the temporary containers ;).

from container-structure-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.