Skip to content

Conversation

@mtojek
Copy link
Contributor

@mtojek mtojek commented Mar 23, 2022

This PR fixes the issue around the processing of docker ps output, where the tool needs to extract container IDs. It looks like there was a bug around splitting.

Starting elastic-package-service_mysql_is_ready_1 ... done
2022/03/23 14:41:51 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service ps -q
,628fb7f951a51e8b59b0286b927656890075bc7ba7c6cfd5f5a672e2c791bdd3fdc03edb18e5acdf20cbb10b7205ee2498236f822bc455371d985a
 628fb7f951a51e8b59b0286b927656890075bc7ba7c6cfd5f5a672e2c791bdd3\Docker\resources\bin\docker.exe inspect 90efe1227efdc03edb18e5acdf20cbb10b7205ee2498236f822bc455371d985a
2022/03/23 14:41:53 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service logs
2022/03/23 14:41:54  INFO Write container logs to file: C:\working_Directory\integrations\build\container-logs\mysql-1648026714086439400.log
Error: up command failed: can't set up the service deployer: service is unhealthy: could not inspect containers (stderr="Error: No such object: 90efe1227efdc03edb18e5acdf20cbb10b7205ee2498236f822bc455371d985a\r\n"): exit status 1

@ManojS-shetty Could you please test if this change helps in your case?

Test steps:

  1. Checkout the branch.
  2. Run make install.
  3. Try to use it against the MySQL package with elastic-package service up -v

@mtojek mtojek requested a review from a team March 23, 2022 09:44
@mtojek mtojek self-assigned this Mar 23, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 23, 2022

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-23T10:45:13.957+0000

  • Duration: 25 min 16 sec

Test stats 🧪

Test Results
Failed 1
Passed 591
Skipped 1
Total 593

Test errors 1

Expand to view the tests failures

Initializing / Integration tests / check-package-gcp / system test: default – gcp.compute
    Expand to view the error details

     null 
    

    Expand to view the stacktrace

     could not find hits in metrics-gcp.compute-ep data stream 
    

Steps errors 1

Expand to view the steps failures

Build elastic-package
  • Took 16 min 28 sec . View more details here
  • Description: make PACKAGE_UNDER_TEST=gcp test-check-packages-parallel

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

timeout := startTime.Add(waitForHealthyTimeout)

containerIDs := strings.Split(strings.TrimSpace(b.String()), "\n")
containerIDs := docker.SplitDockerContainerIDs(b.Bytes())
Copy link
Member

@jsoriano jsoriano Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think strings.Fields() does what we expect here.

Suggested change
containerIDs := docker.SplitDockerContainerIDs(b.Bytes())
containerIDs := strings.Fields(b.String())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I wasn't familiar with this function. Thanks!

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ManojS-shetty
Copy link

@mtojek I have tested this and it is working fine 👍

2022/03/23 15:58:13 DEBUG Enable verbose logging
2022/03/23 15:58:13 DEBUG Distribution built without a version tag, can't determine release chronology. Please consider using official releases at https://github.com/elastic/elastic-package/releases
Boot up the service stack
2022/03/23 15:58:13 DEBUG Create new instance of the service deployer
2022/03/23 15:58:13 DEBUG Boot up the service instance
2022/03/23 15:58:13 DEBUG setting up service using Docker Compose service deployer
2022/03/23 15:58:13 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe version --short
2022/03/23 15:58:15 ERROR Unable to determine Docker Compose version: docker compose version is not a valid semver (value: 1.29.2
): Invalid Semantic Version. Defaulting to 1.x
2022/03/23 15:58:15 DEBUG output command: C:\Program Files\Docker\Docker\resources\bin\docker.exe network inspect elastic-package-stack_default
2022/03/23 15:58:15  INFO Using service variant: ServiceVariant{Name: mysql_5_7_12, Env: IMAGE=mysql:5.7.12}
2022/03/23 15:58:15 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service up --build -d
Building mysql
failed to get console mode for stdin: The handle is invalid.
[+] Building 5.9s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                           0.0s
 => => transferring dockerfile: 32B                                                                                                            0.0s 
 => [internal] load .dockerignore                                                                                                              0.0s 
 => => transferring context: 2B                                                                                                                0.0s 
 => [internal] load metadata for docker.io/library/mysql:5.7.12                                                                                5.5s 
 => [1/3] FROM docker.io/library/mysql:5.7.12@sha256:85a69965ab9cffd7bbfa70ac2dc2f2915859a91de7377fa4b59b363a9fe8c5d3                          0.3s
 => => resolve docker.io/library/mysql:5.7.12@sha256:85a69965ab9cffd7bbfa70ac2dc2f2915859a91de7377fa4b59b363a9fe8c5d3                          0.3s 
 => [internal] load build context                                                                                                              0.0s 
 => => transferring context: 69B                                                                                                               0.0s 
 => CACHED [2/3] COPY healthcheck.sh /healthcheck.sh                                                                                           0.0s
 => CACHED [3/3] COPY entrypoint.sh /test-entrypoint.sh                                                                                        0.0s 
 => exporting to image                                                                                                                         0.0s 
 => => exporting layers                                                                                                                        0.0s 
 => => writing image sha256:29067b965cfbb8b46f967864ccf18746a66d4b938bf7664cfa470d85b831e822                                                   0.0s 
 => => naming to docker.io/library/elastic-package-service_mysql                                                                               0.0s 

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Creating elastic-package-service_mysql_1 ... done
Creating elastic-package-service_mysql_is_ready_1 ... done
2022/03/23 15:58:25 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service ps -q
2022/03/23 15:58:26 DEBUG Wait for healthy containers: 0a6a86c7d511ca4579f33b62aec4fc4cfb17531bb2aa999416a1c2594d57464f,84b54bdc044ce1c7927a11c990a5e772cbc85ad2fd7e3d92d50857b50d7c6f0a
2022/03/23 15:58:26 DEBUG output command: C:\Program Files\Docker\Docker\resources\bin\docker.exe inspect 0a6a86c7d511ca4579f33b62aec4fc4cfb17531bb2aa999416a1c2594d57464f 84b54bdc044ce1c7927a11c990a5e772cbc85ad2fd7e3d92d50857b50d7c6f0a
2022/03/23 15:58:26 DEBUG Container status: {"ID":"0a6a86c7d511ca4579f33b62aec4fc4cfb17531bb2aa999416a1c2594d57464f","State":{"Status":"running","ExitCode":0,"Health":{"Status":"healthy","Log":[{"Start":"2022-03-23T10:28:24.737535176Z","ExitCode":0,"Output":"mysql: [Warning] Using a password on the command line interface can be insecure.\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\nmysql: [Warning] Using a password on the command line interface can be insecure.\n"},{"Start":"2022-03-23T10:28:25.782307892Z","ExitCode":0,"Output":"mysql: [Warning] Using a password on the command line interface can be insecure.\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\nmysql: [Warning] Using a password on the command line interface can be insecure.\n"}]}}}
2022/03/23 15:58:26 DEBUG Container status: {"ID":"84b54bdc044ce1c7927a11c990a5e772cbc85ad2fd7e3d92d50857b50d7c6f0a","State":{"Status":"exited","ExitCode":0,"Health":null}}
2022/03/23 15:58:26 DEBUG run command: C:\Program Files\Docker\Docker\resources\bin\docker.exe network connect elastic-package-stack_default elastic-package-service_mysql_1
2022/03/23 15:58:27 DEBUG adding service container elastic-package-service_mysql_1 internal ports to context
2022/03/23 15:58:27 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service config
Service is up, please use ctrl+c to take it down
Take down the service
2022/03/23 15:58:39 DEBUG tearing down service using Docker Compose runner
2022/03/23 15:58:39 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe version --short
2022/03/23 15:58:39 ERROR Unable to determine Docker Compose version: docker compose version is not a valid semver (value: 1.29.2
): Invalid Semantic Version. Defaulting to 1.x
2022/03/23 15:58:39 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service logs
2022/03/23 15:58:40  INFO Write container logs to file: C:\working_Directory\integrations\build\container-logs\mysql-1648031320844008200.log
2022/03/23 15:58:40 DEBUG running command: C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe -f _dev\deploy\docker\docker-compose.yml -p elastic-package-service down --volumes
Stopping elastic-package-service_mysql_1 ... done
Removing elastic-package-service_mysql_is_ready_1 ... done
Removing elastic-package-service_mysql_1          ... done
Removing network elastic-package-service_default
Removing volume elastic-package-service_mysqldata```

@mtojek
Copy link
Contributor Author

mtojek commented Mar 23, 2022

It looks like you posted also something else:

bin\docker-compose.exe version --short
2022/03/23 15:58:39 ERROR Unable to determine Docker Compose version: docker compose version is not a valid semver (value: 1.29.2
): Invalid Semantic Version. Defaulting to 1.x

@mtojek mtojek merged commit 01d3a31 into elastic:main Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants