Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add e2e envs to devcontainer #2032

Merged
merged 15 commits into from
May 22, 2023
Merged
26 changes: 8 additions & 18 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
{
"name": "Vald",
"image": "vdaas/vald-dev-container:nightly",
"dockerFile": "../dockers/dev/Dockerfile",
"context": "..",
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],

"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"go.useGoProxyToCheckForToolUpdates": false,
"go.useLanguageServer": true,
"go.autocompleteUnimportedPackages": true,
"go.buildOnSave": true,
"go.vetOnSave": true,
"go.lintOnSave": true,
"go.testOnSave": true,
"go.gopath": "/go"
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
}
},
"extensions": [
"golang.Go",
"zxh404.vscode-proto3",
"wayou.vscode-todo-highlight",
"esbenp.prettier-vscode"
],
"postCreateCommand": "go version"
}
27 changes: 13 additions & 14 deletions dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@

ARG MAINTAINER="vdaas.org vald team <[email protected]>"

FROM ubuntu:devel AS builder

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /tmp

# skipcq: DOK-DL3026
FROM mcr.microsoft.com/vscode/devcontainers/go:1 AS base
LABEL maintainer "${MAINTAINER}"
Expand Down Expand Up @@ -64,12 +52,23 @@ COPY versions versions
RUN make ngt/install \
&& make helm/install \
&& make helm-docs/install \
&& make kind/install \
&& make valdcli/install \
&& make yq/install \
&& make golangci-lint/install \
&& make reviewdog/install \
&& make kubectl/install \
&& make protobuf/install

# k3d
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sS https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
kpango marked this conversation as resolved.
Show resolved Hide resolved
# kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
ykadowak marked this conversation as resolved.
Show resolved Hide resolved
kpango marked this conversation as resolved.
Show resolved Hide resolved
RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# k9s
# k9s installs the binary to the current user which is root for devcontainer
# so change the current user to vscode to user afterwards
USER vscode
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sS https://webinstall.dev/k9s | bash
ykadowak marked this conversation as resolved.
Show resolved Hide resolved
ykadowak marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR ${GOPATH}
19 changes: 3 additions & 16 deletions dockers/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

`vald-dev-container` is designed for the development of Vald on Docker.

This image includes some libraries required for implementation and is based on `ubuntu:devel` image.
This image includes some libraries required to develop Vald and is based on `mcr.microsoft.com/vscode/devcontainers/go:1` image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to show the specific URL of mcr.microsoft.com/vscode/devcontainers/go:1


<div align="center">
<img src="https://github.com/vdaas/vald/blob/main/assets/image/readme.svg?raw=true" width="50%" />
</div>

[![latest Image](https://img.shields.io/docker/v/vdaas/vald-dev-container/latest?label=vald-dev-container)](https://hub.docker.com/r/vdaas/vald-dev-container/tags?page=1&name=latest)
[![latest Image](https://img.shields.io/docker/v/vdaas/vald-dev-container/latest?label=vald-dev-container)](https://hub.docker.com/r/vdaas/vald-dev-container/tags?page=1&name=nightly)
[![License: Apache 2.0](https://img.shields.io/github/license/vdaas/vald.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
[![latest ver.](https://img.shields.io/github/release/vdaas/vald.svg?style=flat-square)](https://github.com/vdaas/vald/releases/latest)
[![Twitter](https://img.shields.io/badge/twitter-follow-blue?logo=twitter&style=flat-square)](https://twitter.com/vdaas_vald)
Expand All @@ -24,31 +24,18 @@ This image includes some libraries required for implementation and is based on `
- CPU instruction: requires `AVX2` or `AVX512`
- Tools: Docker

### linux/arm64

- CPU instruction: NOT Apple Silicon
- Tools: Docker

## Get Started

<!-- Get Started -->
<!-- Vald Agent NGT requires more chapter Agent Standalone -->

`vald-dev-container` is used for contributing to Vald's project.

```bash
docker pull vdaas/vald-dev-container
docker run -name vald-dev -dit vdaas/vald-dev-container
docker exec -it vald-dev /bin/bash
```
`vald-dev-container` is used for contributing to Vald's project. Please use this container with [our Dev Container settings](https://github.com/vdaas/vald/blob/main/.devcontainer/devcontainer.json).
ykadowak marked this conversation as resolved.
Show resolved Hide resolved

## Versions

| tag | linux/amd64 | linux/arm64 | description |
| :------ | :---------: | :---------: | :------------------------------------------------------------------------------------------------------------------------------ |
| latest | ✅ | ✅ | the latest image is the same as the latest version of [vdaas/vald](https://github.com/vdaas/vald) repository version. |
| nightly | ✅ | ✅ | the nightly applies the main branch's source code of the [vdaas/vald](https://github.com/vdaas/vald) repository. |
| vX.Y.Z | ✅ | ✅ | the vX.Y.Z image applies the source code of the [vdaas/vald](https://github.com/vdaas/vald) repository. |
| pr-XXX | ✅ | ❌ | the pr-XXX image applies the source code of the pull request XXX of the [vdaas/vald](https://github.com/vdaas/vald) repository. |

## Dockerfile
Expand Down