Giter Club home page Giter Club logo

dockercontainers's Introduction

DockerContainers

Docker container specifications which package dependencies for building Khronos documentation and software.

Images built from this github repository are pushed to the Dockerhub repository https://hub.docker.com/r/khronosgroup/docker-images.

Structure

Each Dockerfile is named <tag>.Dockerfile where <tag> (e.g. openxr, asciidoctor-spec) matches the tag for that image in the Dockerhub repository (e.g. KhronosGroup/docker-images:rust). A second tag is suffixed with .<date> representing a timestamp when this image was last modified.

Scripts

In general, any additional arguments are forwarded on to docker build except the first if it is "push", so this is how you can pass --no-cache to force a rebuild, etc.

  • Single-image scripts: pass a tag name as the first argument and a version as the second.
    • ./build-one.sh <tag> <date> - Just builds and tags the image locally, does not push to Dockerhub. Use for testing modifications.
    • ./build-one.sh <tag> <date> push - Builds and tags the image locally, then pushes it to Dockerhub. Only run this once you've committed (and ideally, pushed) the corresponding changes to this Git repo.
  • ./build-all.sh - Just calls ./build-one.sh on all the tags listed in it. Use as ./build-all.sh push to push all images to Dockerhub. If you add a new Dockerfile to this repo, add it to this script too.

Container Hashes

We have encountered problems with both gitlab and Github Actions CI not flushing cache when an updated image of the same name is pushed to dockerhub. While using different tags on every push is a possibility, another approach is to use the container SHA256 hash instead of the container name. This can be determined at container build time, or as follows:

$ docker inspect --format='{{index .RepoDigests 0}}' khronosgroup/docker-images:asciidoctor-spec
khronosgroup/docker-images@sha256:1535246a0270e5a118b11ba121ac3c08849782d27afcac28e3859424db659f2f

Using the last line as the image name in CI will pull that specific hash instead of whatever the currently cached version of the underlying image name is. This works in both gitlab and Github Actions.

dockercontainers's People

Contributors

marijns95 avatar naghasan avatar oddhack avatar rpavlik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockercontainers's Issues

Missing python module pyparsing

Tried to build the Vulkan spec today and got

Traceback (most recent call last):
  File "/vulkan/scripts/genvk.py", line 19, in <module>
    from docgenerator import DocGeneratorOptions, DocOutputGenerator
  File "/vulkan/scripts/docgenerator.py", line 10, in <module>
    from parse_dependency import dependencyLanguage
  File "/vulkan/scripts/parse_dependency.py", line 15, in <module>
    from pyparsing import (
ModuleNotFoundError: No module named 'pyparsing'

Extremely slow CI

I'm not sure what repo CI is doing - the Azure files are beyond my pay grade at present - but it is taking approximately forever (35 minutes, at this point). If it's building all the images from scratch, let's not do that!

Support direct command invocation in vulkan-docs

I just started using the Khronos Docker image to successfully build the Vulkan spec HTML, and happy to see that the HTML loads much faster in my default browser (Firefox).

One thing I want to be able to do is directly trigger a build inside the Docker container without using an interactive shell. I want to do that so I can update my already-existing "build anything" script to trigger a build directly from a shell on my Windows development system. When I use the generic Ubuntu Docker image, I can do this successfully. But this doesn't work in the Khronos vulkan-docs image:

C:\Windows\system32>docker run --rm --name test ubuntu /bin/ls -C /
bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
boot  etc  lib   media  opt  root  sbin  sys  usr

C:\Windows\system32>docker run --rm --name test khronosgroup/docker-images:vulkan-docs /bin/ls -C /
** Creating user vulkan id 1000
HOME=/home/vulkan USER=vulkan CONTAINER_CWD=
** ignoring entrypoint.vulkan.sh args - length was 13
** About to gosu vulkan /bin/bash

It looks like the problem might be related to this override in /root/entrypoint.vulkan.sh that seems to trigger an interactive Bash shell no matter what you pass on the command line:

# Default to 'bash' if no arguments are provided
args="$@"
if [ -z "$args" ]; then
    args=/bin/bash
else
    # Actually, always use it, because CI appears to be passing in some horrid bash script as the arguments
    echo -n "** ignoring entrypoint.vulkan.sh args - length was "
    echo $args | wc -c
    args=/bin/bash
fi

Thanks,
Pat

Add packages for remote asciidoctor image support

It's possible to use image: sources with are remote URLs, but requires a couple of packages not in the Vulkan images. Need to add these:

  • Debian package graphicsmagick-libmagick-dev-compat
  • gem prawn-gmagick

Unfortunate there's an issue in the asciidoctor stack itself which means it can't deal properly with remote URLs that don't have file format suffixes (.svg, .jpg, etc.) but otherwise it works. The asciidoctor attribute '-a allow-uri-read' must be set for this to work.

Please rename default branch from 'master' to 'main' per Khronos policy

To repository owners: please rename the default branch of this repository from 'master' to 'main', using the Github renaming tool. This request is per policy set by the Khronos Promoters in May 2021, to follow Github community practice for respectful naming.

The Github renaming tool sets up URL redirections and retargets outstanding pull requests, so the impact on repository users is minimal. The most visible issue is that people with local repo clones will probably want to rename their clone's 'master' branch, following the popup instructions that will be seen when browsing the github repository after the change; or just delete 'master' and pull the new 'main', if it's purely a tracker with no local content.

You may wish to coordinate with @outofcontrol if you are doing auto-updates from this repository to another location, whether via push/pull mirroring or other mechanisms. The redirects setup by Github should accommodate most such uses transparently, but it's still good practice.

Based on experience with other KhronosGroup repositories which have undergone this renaming already, this is a reasonable approach:

  • Agree on a date for the renaming within the Working Group or other owners of the repository, and document that date here.
    • Date can be adjusted to avoid interaction with major releases in flight.
  • Provide notice to repository users outside Khronos, insofar as possible (adding a comment in the repo README with the switchover date is one way).
  • Once the renaming is done, edit the new 'main' branch to replace hardwired references to 'master' with (preferably) 'default branch' or 'main'.
  • Update the repo README to note the change.

If you have questions or issues about this, please raise them on Khronos internal gitlab 'khronos-general' issue 106 if possible. If not possible, you can @-tag me here.

While we will not force any WG into acting precipitously, this is our agreed policy. Please try to accommodate renaming relatively soon.

Note that this issue is automatically generated, due to the large number of KhronosGroup repositories it's being raised in.

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.