Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Effective Container with VSCode Remote Container

Effective Container with VSCode Remote Container

Effective container for developers.

Hiroki Matsumoto

May 12, 2020
Tweet

More Decks by Hiroki Matsumoto

Other Decks in Technology

Transcript

  1. Effective Container

    View Slide

  2. Why we have been using container?

    View Slide

  3. ☑ Portablity
    ☑ Lightweight
    ☑ Fast startup
    ☑ Easy version control
    Container: Pros

    View Slide

  4. So... Have you been happy
    after introducing container ?

    View Slide

  5. About speaking
    + For Developers.
    + Using Visual Studio Code with Remote Container.
    + Scope of Containerization.
    + Don't lose the benefits of IDE.
    + Handle container more clearly.

    View Slide

  6. What is VSCode Remote Container?
    https://code.visualstudio.com/docs/remote/containers

    View Slide

  7. Scope of Containerization

    View Slide

  8. PROBLEM: What did I face ?
    Didn't work with the version of ansible written in the README.
    Didn't work without ruby in my local environment.
    + We need to keep the documentation consistent with the actual version.
    ( It is time consuming. To be honest,not fun.)
    + We need version control of the installation module in Indivisual Env.
    ( Who switches the version? It's me! )

    View Slide

  9. RESOLVED
    Provide the environment,not explain install procedures.
    example:https://github.com/h-r-k-matsumoto/iac-terminal.git
    Just open in Remote Container.
    + Everything you need is installed.No version switch operation required.
    + VS Code extension has also been installed.
    + You can use the features of VS Code.
    CI can be easily performed by the container.

    View Slide

  10. Don't lose the benefits of IDE.

    View Slide

  11. PROBLEM: What did I face ?
    I'm not vimmer!! I want to use IDE!!
    It's hard to debug by printing.but...installing XDEBUG is more difficult.
    refer to:
    https://stackoverflow.com/questions/58317736/installation-of-xdebug-on-macos-
    catalina-10-15
    ※ We don't have permission to write /usr/local.

    View Slide

  12. RESOLVED
    Containerize entire development environment.
    example:https://github.com/h-r-k-matsumoto/quickstart-basic.git
    Just open in Remote Container.
    + Everything you need is installed.No version switch operation required.
    + VS Code extension has also been installed.
    + You can use the features of VS Code.
    + Debugging: Breakpoint,Step over,Step in…
    + Jump to Definition
    + Search method,class.

    View Slide

  13. TIPS
    How to more better containerize.
    Dockerfile
    FROM xxxx as base # using production base image.
    RUN add debug components.

    View Slide

  14. Handle container more clearly.

    View Slide

  15. PROBLEM: What did I face ?
    I want to limit the resources consumed.
    If use Kubernetes, we have to confirm specs of application.

    View Slide

  16. RESOLVED
    Use Resources definition,or create Kubernetes's manifests
    more details, please check following page.
    https://docs.docker.com/compose/compose-file/#resources
    docker-compose.yaml
    version: '3.7'
    services:
    web:
    image: stefanprodan/podinfo:3.2.3
    ports:
    - "9898:9898"
    deploy:
    resources:
    limits:
    cpus: '0.1'
    memory: 100M
    reservations:
    cpus: '0.1'
    memory: 100M

    View Slide

  17. TIPS
    More details,please check following Web site.
    + Completely Fair Scheduler
    https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/6/html/resou
    rce_management_guide/sec-cpu
    + Kubernetes QoS/Eviction Policy
    https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
    https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/
    + Blocking I/O -> Non-Blocking I/O
    ノンブロッキングI/Oと非同期I/Oの違いを理解する
    + Squid
    https://blog.cybozu.io/entry/2017/02/03/080000

    View Slide

  18. Thank you.

    View Slide