-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional DEBUG info to che-launcher #1957
Conversation
Build # 1315 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1315/ to view the results. |
LGTM |
@@ -117,6 +117,14 @@ get_docker_host_ip() { | |||
awk '{ print $2}' | |||
} | |||
|
|||
get_docker_host_os() { | |||
echo $(docker info | grep "Operating System:" | sed "s/^Operating System: //") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of 'echo $(cmd)', just use 'cmd'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Great job @TylerJewell ! I've written some tests to verify your new functions and everything worked well (except get_docker_daemon_version). Can you add these to launcher_tests.bats please? @test "get container conf folder that is set" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-container-conf-folder"
CONF_FOLDER=$(pwd)/che-test-conf
mkdir ${CONF_FOLDER}
docker run --name ${CHE_SERVER_CONTAINER_NAME} -v ${CONF_FOLDER}:/conf alpine:3.4 true
# When
result="$(get_che_container_conf_folder)"
docker rm -f ${CHE_SERVER_CONTAINER_NAME}
rmdir ${CONF_FOLDER}
# Then
[ "$result" = "${CONF_FOLDER}" ]
}
@test "get container conf folder that is not set" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-container-conf-folder"
docker run --name ${CHE_SERVER_CONTAINER_NAME} alpine:3.4 true
# When
result="$(get_che_container_conf_folder)"
docker rm -f ${CHE_SERVER_CONTAINER_NAME}
# Then
[ "$result" = "not set" ]
}
@test "get container data folder" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-container-data-folder"
DATA_FOLDER=$(pwd)/che-test-data
mkdir ${DATA_FOLDER}
docker run --name ${CHE_SERVER_CONTAINER_NAME} -v ${DATA_FOLDER}:/home/user/che/workspaces/ alpine:3.4 true
# When
result="$(get_che_container_data_folder)"
docker rm -f ${CHE_SERVER_CONTAINER_NAME}
rmdir ${DATA_FOLDER}
# Then
[ "$result" = "${DATA_FOLDER}" ]
}
@test "get image name" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-container-image-name"
docker run --name ${CHE_SERVER_CONTAINER_NAME} alpine:3.4 true
# When
result="$(get_che_container_image_name)"
docker rm -f ${CHE_SERVER_CONTAINER_NAME}
# Then
[ "$result" = "alpine:3.4" ]
}
@test "get che server container id" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-container-id"
long_id=$(docker run -d --name ${CHE_SERVER_CONTAINER_NAME} alpine:3.4 true)
short_id=${long_id:0:12}
# When
result="$(get_che_server_container_id)"
docker rm -f ${CHE_SERVER_CONTAINER_NAME}
# Then
[ "$result" = "$short_id" ]
}
@test "get docker daemon version" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-docker-version"
# When
result="$(get_docker_daemon_version)"
# Then
[ "$result" ]
}
@test "get docker host os" {
# Given
export CHE_SERVER_CONTAINER_NAME="che-test-get-docker-host-os"
# When
result="$(get_docker_host_os)"
# Then
[ "$result" ]
} |
@l0rd @garagatyi - made fixes. Also, I included a fix for this issue. |
Build # 1324 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1324/ to view the results. |
@@ -184,7 +224,7 @@ wait_until_container_is_stopped() { | |||
} | |||
|
|||
server_is_booted() { | |||
HTTP_STATUS_CODE=$(curl -I http://"${CHE_HOST_IP}":"${CHE_PORT}"/api/ \ | |||
HTTP_STATUS_CODE=$(curl -I http://$(docker inspect -f '{{.NetworkSettings.IPAddress}}' che-server):8080/api/ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you would better replace che-server with ${CHE_SERVER_CONTAINER_NAME}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
Aside my last comment LGTM |
* Added more debug info * update tests * debug changes * fix container server
* Added more debug info * update tests * debug changes * fix container server
What does this PR do?
This pull request adds additional information to the 'info' command on the 'che-launcher'.
What issues does this PR fix or reference?
#1951
New Behavior
run
docker run -v /var/run/docker.sock:/var/run/docker.sock codenvy/che-launcher info
Tests written?
No
Docs requirements?
Docs not needed.
Please review Che's Contributing Guide for best practices.