-
Notifications
You must be signed in to change notification settings - Fork 0
Understanding the stuff.
This page will be focusing on understanding that how build-kite works, what's inside the repo, how to create a docker, use docker-compose and run docker-compose with nvidia support so that it utilized the host GPU.
- Buildkite uses two files, a)
template.ymlb)pipeline.ymllocated inside the hidden folder.builtkiteof this repo. -
template.ymlis used for the creation of testing pipeline. As explained on page-2. Buildkite reads thecommand.
-
pipeline.ymlcontains the commands used for the testing. Once the pipeline is created and repos are cloned inside running agent, buildkite will run thecommand. Buildkite is using the docker plugin in this repo. So once the docker-image is built, container is running, it'll execute thecommandinside the docker. In this case,py.testwill run all the python test scripts located inside the working directory.
-
The
Dockerfileused in this repo looks like this.
-
ARGSrepresent the variables. -
FROMis used when we want a pre-built docker container to be used as base image. Docker will look for this image inside the local host, if not found, it will fetch it from server. It's more like animportcommand used in python. -
ENVrepresent the environment variables to be used while running this docker image. -
RUNare the sequence of commands used while building this docker image. -
WORKDIRis likepwd. It will switch to this directory once docker container is up and running. -
COPYis used to copy the contents from local directory to docker image. -
CMDis the command run when docker is up. -
To build the docker image. Run the following command inside the folder where
Dockerfileis located. -
docker build -t numpy-docker . -
It would take some good amount of time to download and setup docker image.
-
Once build, run the docker image using following command.
-
docker run -it --rm numpy-docker -
To run the docker with nvidia support (so that you're able to use host machine's GPU inside docker) run the following command.
-
docker run --runtime=nvidia -it --rm numpy-docker
- Build-kite uses docker-compose instead of docker.
- docker-compose is a handy utility of managing and running multiple docker images/containers using only 1 command. docker-compose uses the file
docker-compose.ymlto read the configurations. - docker-compose file used in this repo looks like this.
- docker-compose reads the Dockerfile to build a container.
-
servicesare the containers you want to run. You can add more if you need. -
buildis the same as running the docker build command. -
runtimeis the same as explained above. -
commandis the command run once the container is up. - To build a docker-image using docker-compose, run the following command.
docker-compose --build- To run the docker-image.
docker-compose up- To stop the container.
docker-compose down