Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
01f3e26
change out .devcontainer content to support current requirements insi…
Apr 8, 2021
4eee5c7
Merge branch 'main' into emily/codespaces-dev-envts
Apr 8, 2021
519ce22
Merge branch 'main' into emily/codespaces-dev-envts
Apr 8, 2021
62117ee
Merge branch 'main' into emily/codespaces-dev-envts
Apr 12, 2021
8895dd7
add auto-build workflow for base Codespaces image
Apr 12, 2021
0a33291
Merge branch 'emily/codespaces-dev-envts' of https://github.com/Azure…
Apr 12, 2021
5542411
new codespaces github workflow
emily-potyraj Apr 13, 2021
66076ec
Update devcontainer.json
emily-potyraj Apr 13, 2021
306e326
Delete Dockerfile
emily-potyraj Apr 13, 2021
23de0bf
Update codespaces.yaml
emily-potyraj Apr 13, 2021
cc2b4fa
Update codespaces.yaml
emily-potyraj Apr 13, 2021
faeba32
Update first-run-notice.txt
emily-potyraj Apr 14, 2021
c48bc1a
Delete README.md
emily-potyraj Apr 14, 2021
f460892
Update azcli-debian.sh
emily-potyraj Apr 14, 2021
99caac6
Update kubectl-helm-debian.sh
emily-potyraj Apr 14, 2021
b499f67
Update devcontainer.json
emily-potyraj Apr 14, 2021
e347d89
EOL changes enforced by .gitattributes (no manual changes in this com…
Apr 19, 2021
67d02c4
combine codespaces.yaml into build.yaml. use new buildx github actions.
Apr 21, 2021
1388247
cleanup unused lines
Apr 21, 2021
ec73d28
Delete codespaces.yaml
emily-potyraj Apr 21, 2021
1f31731
make codespaces build depend on publish
Apr 21, 2021
5898228
Merge branch 'emily/codespaces-dev-envts' of https://github.com/Azure…
Apr 21, 2021
ec340b7
Merge branch 'main' into emily/codespaces-dev-envts
emily-potyraj Apr 21, 2021
a41b76b
don't specify DockerHub registry name explicitly
emily-potyraj Apr 21, 2021
acd7b19
Update build.yaml
emily-potyraj Apr 21, 2021
baddbd1
auto-generate image tags and labels.
Apr 26, 2021
ecdb117
revert to previous build method with Makefile for general build.
Apr 29, 2021
e327447
Merge branch 'main' into emily/codespaces-dev-envts
emily-potyraj Apr 29, 2021
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
38 changes: 0 additions & 38 deletions .devcontainer/Dockerfile

This file was deleted.

39 changes: 0 additions & 39 deletions .devcontainer/copy-kube-config.sh

This file was deleted.

43 changes: 14 additions & 29 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,22 @@
{
"name": "Radius",
"dockerComposeFile": ["./docker-compose.yaml"],
"service": "rp",
"workspaceFolder": "/workspace/radius",
"remoteEnv": {
"SYNC_LOCALHOST_KUBECONFIG": "true"
},
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

"name": "Codespaces for Radius tutorials",
Comment thread
emily-potyraj marked this conversation as resolved.

"image": "radiusteam/radcodespace:latest",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"go.useGoProxyToCheckForToolUpdates": false,
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.toolsGopath": "/go/bin"
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools"
"ms-vscode.azurecli",
"ms-dotnettools.vscode-dotnet-runtime",
"/home/rad-vscode-bicep.vsix"
],

"forwardPorts": [3000],
Comment thread
emily-potyraj marked this conversation as resolved.

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5000],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "&& go mod download",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"shutdownAction": "stopCompose"
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
37 changes: 0 additions & 37 deletions .devcontainer/docker-compose.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions .devcontainer/init-profile.sh

This file was deleted.

23 changes: 23 additions & 0 deletions .devcontainer/tutorials-codespace/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG VARIANT=3.1
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}

USER root

# Install library scripts & setup "first notice"
COPY library-scripts/* first-run-notice.txt /tmp/library-scripts/
RUN bash /tmp/library-scripts/azcli-debian.sh \
&& bash /tmp/library-scripts/kubectl-helm-debian.sh \
&& mv -f /tmp/library-scripts/first-run-notice.txt /usr/local/etc/vscode-dev-containers/ \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
Comment thread
emily-potyraj marked this conversation as resolved.

# Install rad CLI (Linux)
# TODO: change to make binary directly inside this Dockerfile?
RUN wget -O /usr/local/bin/rad https://radiuspublic.blob.core.windows.net/tools/rad/edge/linux-x64/rad
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think a better thing to do might be to make this part of the build.yaml workflow and then you can copy in rad from the same build.

Ex: https://github.com/Azure/radius/blob/main/.github/workflows/build.yaml#L154

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment is marked as resolved but it's still downloading this from the storage URL - are you planning to have someone else fix this later or was the resolution different from what I remember?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

based on our chat earlier this week, I opened a new issue #322 for that change to pulling rad directly

RUN chmod +rx /usr/local/bin/rad

# Download Radius VSCode extension
RUN wget -O /home/rad-vscode-bicep.vsix https://radiuspublic.blob.core.windows.net/tools/vscode/edge/rad-vscode-bicep.vsix

USER vscode

RUN touch ~/.vimrc
5 changes: 5 additions & 0 deletions .devcontainer/tutorials-codespace/first-run-notice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

👋 Welcome to the Radius Codespace! You are on our Radius Tutorials image. It includes everything needed to run through our tutorials and example applications.
Radius docs can be found here: https://radapp.dev/


Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/azcli.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./azcli-debian.sh

set -e

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

export DEBIAN_FRONTEND=noninteractive

# Install curl, apt-transport-https, lsb-release, or gpg if missing
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
fi

# Install the Azure CLI
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list
curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
apt-get update
apt-get install -y azure-cli
echo "Done!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/kubectl-helm.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./kubectl-helm-debian.sh

set -e

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

export DEBIAN_FRONTEND=noninteractive

# Install curl if missing
if ! dpkg -s curl ca-certificates > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends curl ca-certificates
fi

# Install the kubectl
echo "Downloading kubectl..."
curl -sSL -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x /usr/local/bin/kubectl
# Install Helm
echo "Installing Helm..."
curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -
echo "Done!"
59 changes: 53 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,57 @@ jobs:
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
sync: true
extra_args: '--destination-path rad/${{ env.REL_CHANNEL }}/windows-x64/ --pattern rad.exe'
- uses: bacongobbler/azure-blob-storage-upload@v1.1.1

codespaces:
name: Codespaces container image build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Parse release version and set environment variables
run: python ./.github/scripts/get_release_version.py
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
source_dir: install
container_name: 'tools'
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
sync: true
extra_args: '--destination-path rad/ --pattern install.*'
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: '${{ secrets.RADIUSTEAM_DOCKERHUB_USERNAME }}'
password: '${{ secrets.RADIUSTEAM_DOCKERHUB_PASSWORD }}'
- name: Build and push - Codespaces (latest)
if: (github.ref == 'refs/heads/main') # push image on push to main
uses: docker/build-push-action@v2
with:
context: ./.devcontainer/tutorials-codespace/
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: radiusteam/radcodespace:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push - Codespaces (PR)
if: startsWith(github.ref, 'refs/pull/') # push image on pr
uses: docker/build-push-action@v2
with:
context: ./.devcontainer/tutorials-codespace/
builder: ${{ steps.buildx.outputs.name }}
push: false # don't push image on pr
tags: radiusteam/radcodespace:${{ env.REL_VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push - Codespaces (release)
if: startsWith(github.ref, 'refs/tags/v') # push image on tag
uses: docker/build-push-action@v2
with:
context: ./.devcontainer/tutorials-codespace/
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: radiusteam/radcodespace:${{ env.REL_CHANNEL }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ For help and questions about using this project, please email radiusct@microsoft

## Microsoft Support Policy

Support for this project is limited to the resources listed above.
Support for this project is limited to the resources listed above.