Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Docker dev container #338

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/go
{
"name": "flyteidl",
"dockerComposeFile": "../docker-compose.devcontainer.yml",
"service": "devcontainer",

"workspaceFolder": "/usr/src/flyteidl",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go"
]
}
}
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ This is one of the core repositories of Flyte. It contains the Specification of

## Tooling for Flyteidl

1. Run ``make download_tooling`` to install generator dependencies.
1. Ensure Docker is installed locally.

2. If using Visual Studio Code, open the project in dev container. If not, run `docker-compose up` to start a dev container, and `docker-compose exec devcontainer bash` to SSH into it.

```bash
make download_tooling
docker-compose up -d
docker-compose exec devcontainer bash
```

2. Ensure Docker is installed locally.
3. Run ``make generate`` to generate all the code, mock client, and docs for FlyteAdmin Service.

```bash
Expand Down
11 changes: 11 additions & 0 deletions devcontainer.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.18.5
Copy link
Author

Choose a reason for hiding this comment

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

Is 1.18.5 the correct Golang version?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is ok. Most people are using a flavor of 1.18 anyways.

We're also investing in a monorepo, which will make this kind of standardization a lot easier.


WORKDIR /usr/src/flyteidl

COPY Makefile ./
COPY boilerplate ./boilerplate
COPY go.mod ./
COPY go.sum ./

# install tools and dependencies
RUN make update_boilerplate install
18 changes: 18 additions & 0 deletions docker-compose.devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
devcontainer:
build:
context: .
dockerfile: devcontainer.Dockerfile
volumes:
- ./:/usr/src/flyteidl:cached

# Required for debugging
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"