GithubHelp home page GithubHelp logo

sodalite-eu / image-builder Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 291 KB

Image builder contains components needed to build images within the SODALITE platform

License: Apache License 2.0

Python 67.94% Shell 29.16% Dockerfile 2.90%

image-builder's People

Contributors

alexmaslenn avatar dradx avatar mihatrajbaric avatar pmundt avatar snyk-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pmundt

image-builder's Issues

Poor documentation

Besides JSON payloads and sample TOSCA inputs, there is not any real documentation on image-builder usage, which can lead to confusion

Dockerfile inside build_context

Image builder dockerfile mode expects Dockerfile to be provided with source_url (or source.url in TOSCA) param, which can then be inserted into build context (arbitrary git repo). This 2-component approach was introduced to support snow-uc, with code in one repo and dockerfiles in another repo.

Since most projects have Dockerfile in its own git repository, image-builder could provide a simpler way, without specifying two separate URLs for dockerfile and build context/

Multi-arch image support

Since the beginning, we have required multi-arch containers from the image builder. At present, it is limited to the host architecture of wherever the ansible docker plugin is invoked, which we have been using as a workaround for building arm64 images in our Edge testbed. An additional consideration is the creation of the image manifest which is able to provide resolutions to different architecture image variants in the container registry.

As we are now aiming to have increased integration in Y3, it's no longer possible to work around this limitation, and it will need to be addressed directly in the image builder.

Both of these issues are addressable through the use of docker buildx, however, the last time we looked at this there was no direct support in the Ansible docker plugin, and so it was decided to temporarily shelve this discussion and revisit later in the project. The upstream community has, unfortunately, not already taken care of this for us in the meantime. Presumably, the easiest solution would now be to extend the existing Docker Ansible plugin to support the buildx extensions directly.

I am happy to support this work, but do not presently have the spare cycles to implement this myself.

Support for Singularity image building

Similarly to Docker images building, we should provide a means for building Singularity images with ability to push the images either into public Singularity Hub or private Singularity registry that would be deployed in the testbed. This is needed for other SODALITE services, such as MODAK, and HPC use cases. An example of a Singularity definition file can be found here.

Dockerfile not built relative to git tree path

In trying to build a simple image with the image builder, there seems to be a problem with the working directory of the builder not being pivoted to the cloned git tree. This generates a build failure when we need to COPY files relative to the cloned tree:

                {
                    "hosts": {
                        "opera": {
                            "_ansible_no_log": false,
                            "action": "docker_image",
                            "changed": false,
                            "failed": true,
                            "invocation": {
                                "module_args": {
                                    "api_version": "auto",
                                    "archive_path": null,
                                    "build": {
                                        "args": null,
                                        "cache_from": null,
                                        "container_limits": null,
                                        "dockerfile": null,
                                        "etc_hosts": null,
                                        "http_timeout": null,
                                        "network": null,
                                        "nocache": false,
                                        "path": "/home/image_builder/5959f0d2-fcaa-59ab-aeae-e2e16d45179c",
                                        "pull": true,
                                        "rm": true,
                                        "target": null,
                                        "use_config_proxy": null
                                    },
                                    "buildargs": null,
                                    "ca_cert": null,
                                    "client_cert": null,
                                    "client_key": null,
                                    "container_limits": null,
                                    "debug": false,
                                    "docker_host": "unix://var/run/docker.sock",
                                    "dockerfile": null,
                                    "force": null,
                                    "force_absent": false,
                                    "force_source": true,
                                    "force_tag": false,
                                    "http_timeout": null,
                                    "load_path": null,
                                    "name": "adaptant/edgetpu-exporter",
                                    "nocache": false,
                                    "path": null,
                                    "pull": null,
                                    "push": true,
                                    "repository": "docker.io/adaptant/edgetpu-exporter:latest",
                                    "rm": true,
                                    "source": "build",
                                    "ssl_version": null,
                                    "state": "present",
                                    "tag": "latest",
                                    "timeout": 60,
                                    "tls": false,
                                    "tls_hostname": "localhost",
                                    "use_tls": null,
                                    "validate_certs": false
                                }
                            },
                            "msg": "Error building adaptant/edgetpu-exporter - code: None, message: COPY failed: stat /var/lib/docker/tmp/docker-builder229831268/go.mod: no such file or directory, logs: ['Step 1/11 : FROM golang as builder', '\\n', ' ---> 00d970a31ef2\\n', 'Step 2/11 : ENV GO111MODULE=on', '\\n', ' ---> Using cache\\n', ' ---> 05bf77a42124\\n', 'Step 3/11 : WORKDIR /app', '\\n', ' ---> Using cache\\n', ' ---> 419cfb13a115\\n', 'Step 4/11 : COPY go.mod .', '\\n']"
                        }
                    },
                    "task": {
                        "duration": {
                            "end": "2020-07-04T15:23:23.285719Z",
                            "start": "2020-07-04T15:23:20.348292Z"
                        },
                        "id": "834b0bfa-0d98-0ec5-0dee-000000000018",
                        "name": "Build image and push it"
                    }
                }

Poor test coverage

At the moment, tests cover just basic API functionality (endpoints user and auth) and fail to test core image-builder engine.

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.