Giter Site home page Giter Site logo

waaghals / toip Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 208 KB

Configure your development tools as containers. Allows all developers to use the exact same tooling without having to install or manage them manually. Run them as if they are install locally.

Rust 99.90% Dockerfile 0.10%
cli container development rust

toip's People

Stargazers

 avatar

Watchers

 avatar

toip's Issues

Improve image pulling

  • Remove unnecessary copy (between downloading layer and extracting layer)
  • Use Rayon
    • Convert layer download from for loop to map
    • Zip diff_id with manifest.layers
    • Convert to Rayon with par_iter()
    • Render multiple progress bars using MultiProgress

Config debug command

Add a command to debug the parsed configuration

arguments:
$ toip config debug

Serialize config into yaml

Configure volume for containers

  • Allow absolute paths configured in user config
  • Error when volume is not known in main config

Example configuration:

# toip.yaml
containers:
  container_with_volumes:
    image: ...
    volumes:
      /absolute/path/in/container: volume_a
      /path: volume_b

  other_container:
    image: ...
    mounts:
      /path: volume_b
      /other/path: volume_c

volumes:
  volume_a:
    source: relative/path/relative/to/config/file
    readonly: true
  volume_b: 
    source: shared/between/containers
  volume_c:
    name: anonymous
  volume_d:
    name: ${ENV_VAR}
    external: true
  volume_e: 
    source: ${HOME}/in/home/dir

Give ready signal when call listener is ready

Both the call/instructions listener and the call invocation happen in separate threads.
But the call invocation should only happen after the call/instructions listener is ready.

Now the call invocation sleeps for 100ms before actually passing the message to the socket, but it could wait for a ready signal.

Modify configuration using .env substitution

Allow values to be env substituted. Loads .env and uses processes available env vars.

Example:

aliases:
  ...
containers:
  container_a:
    image:
      context: .
      target: ${TARGET}
    cmd: ${COMMAND_TARGET}
    volumes:
      /app: ${VOLUME_NAME:-path_substitution}
    env:
      CONTAINER_VARIABLE: ${ENV_FROM_HOST}
    workdir: ${WORKDIR}
  container_b:
    image: some_image:${TAG}
  container_c:
    image: ${IMAGE}
volumes:
  path_substitution:
    source: ${PATH}/more
    readonly: true
  name_substitution:
    name: ${VOLUME_NAME?missing volume}

Support pluggable backends

Use higher level tooling for running the containers instead of doing the heavy lifting our self.

Backend Driver CLI
colima docker docker docker
colima containerd nerdctl colima nerdctl
lima nerdctl lima nerdctl
podman docker podman
nerdctl nerdctl nerctl
docker docker docker

nerdctl is docker compatible, so does not need to be implemented initially. Only when requiring nerdctl specific features.

Cleanup

  • Cleanup dependencies
  • Remove runc stuff
  • Remove OCI handling

RUSTSEC-2020-0071: Potential segfault in the time crate

Potential segfault in the time crate

Details
Package time
Version 0.1.43
URL time-rs/time#293
Date 2020-11-18
Patched versions >=0.2.23
Unaffected versions =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

The affected functions from time 0.2.7 through 0.2.22 are:

  • time::UtcOffset::local_offset_at
  • time::UtcOffset::try_local_offset_at
  • time::UtcOffset::current_local_offset
  • time::UtcOffset::try_current_local_offset
  • time::OffsetDateTime::now_local
  • time::OffsetDateTime::try_now_local

The affected functions in time 0.1 (all versions) are:

  • at
  • at_utc
  • now

Non-Unix targets (including Windows and wasm) are unaffected.

Patches

Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

Workarounds

No workarounds are known.

References

time-rs/time#293

See advisory page for additional details.

Prompt returns to soon

Reproduce:

  1. Run sh from with cargo run -- run sh_musl
  2. Run linked container cowsay like cowsay hi

Expected output:

/ # cowsay hi
 ____
< hi >
 ----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
/ # 

Actual output

/ # cowsay hi
/ #  ____
< hi >
 ----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Improve CLI commands

  • Update clap crate to 3.0, remove structopt crate
  • Organize commands into separate directories

RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations

Potential segfault in localtime_r invocations

Details
Package chrono
Version 0.4.19
URL chronotope/chrono#499
Date 2020-11-10

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

See advisory page for additional details.

Remove init process

No longer needed. Initially created to modify a container's PATH variable, but that is now handled in the OCI runtime bundle.

Add inject command to configure path on host

  • Create run scripts into special directory (hashed to directory of current config)
  • Symlink current run script dir into current $PATH
  • Skip directories without configuration file
  • Traverse up the directories to find first available configuration
Configure cd 'hooks' Add flag to configure re-export of PATH Documentation
Bash
Fish
Zsh

Similar to starship.

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.