def dagster_docker_image(): docker_image = get_test_project_docker_image() if not IS_BUILDKITE: # Being conservative here when first introducing this. This could fail # if the Docker daemon is not running, so for now we just skip the tests using this # fixture if the build fails, and warn with the output from the build command try: client = docker.from_env() client.images.get(docker_image) print( # pylint: disable=print-call "Found existing image tagged {image}, skipping image build. To rebuild, first run: " "docker rmi {image}".format(image=docker_image) ) except docker.errors.ImageNotFound: try: build_and_tag_test_image(docker_image) except subprocess.CalledProcessError as exc_info: pytest.skip( "Skipped container tests due to a failure when trying to build the image. " "Most likely, the docker deamon is not running.\n" "Output:\n{}".format(exc_info.output.decode("utf-8")) ) return docker_image
def dagster_docker_image(): docker_image = test_project_docker_image() if not IS_BUILDKITE: # Being conservative here when first introducing this. This could fail # if the Docker daemon is not running, so for now we just skip the tests using this # fixture if the build fails, and warn with the output from the build command try: build_and_tag_test_image(docker_image) except subprocess.CalledProcessError as exc_info: pytest.skip( "Skipped container tests due to a failure when trying to build the image. " "Most likely, the docker deamon is not running.\n" "Output:\n{}".format(exc_info.output.decode())) return docker_image