Skip to content

Commit 9d58583

Browse files
authored
Merge branch 'main' into feature/oci-template
2 parents 9995c0d + cf66809 commit 9d58583

File tree

9 files changed

+438
-9
lines changed

9 files changed

+438
-9
lines changed

.github/workflows/deploy-registry.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: deploy-registry
22

33
on:
4+
schedule:
5+
# Runs at 02:30 UTC Monday through Friday
6+
- cron: "30 2 * * 1-5"
47
push:
58
tags:
69
# Matches release/<namespace>/<resource_name>/<semantic_version>

registry/coder/modules/hcp-vault-secrets/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ tags: [integration, vault, hashicorp, hvs]
1515
>
1616
> **Use these Coder registry modules instead:**
1717
>
18-
> - **[vault-token](https://registry.coder.com/modules/vault-token)** - Connect to Vault using access tokens
19-
> - **[vault-jwt](https://registry.coder.com/modules/vault-jwt)** - Connect to Vault using JWT/OIDC authentication
20-
> - **[vault-github](https://registry.coder.com/modules/vault-github)** - Connect to Vault using GitHub authentication
18+
> - **[vault-token](https://registry.coder.com/modules/coder/vault-token)** - Connect to Vault using access tokens
19+
> - **[vault-jwt](https://registry.coder.com/modules/coder/vault-jwt)** - Connect to Vault using JWT/OIDC authentication
20+
> - **[vault-github](https://registry.coder.com/modules/coder/vault-github)** - Connect to Vault using GitHub authentication
2121
>
2222
> These modules work with both self-hosted Vault and HCP Vault Dedicated. For migration help, see the [official HashiCorp announcement](https://developer.hashicorp.com/hcp/docs/vault-secrets/end-of-sale-announcement).
2323
@@ -26,7 +26,7 @@ This module lets you fetch all or selective secrets from a [HCP Vault Secrets](h
2626
```tf
2727
module "vault" {
2828
source = "registry.coder.com/coder/hcp-vault-secrets/coder"
29-
version = "1.0.33"
29+
version = "1.0.34"
3030
agent_id = coder_agent.example.id
3131
app_name = "demo-app"
3232
project_id = "aaa-bbb-ccc"
@@ -52,7 +52,7 @@ To fetch all secrets from the HCP Vault Secrets app, skip the `secrets` input.
5252
```tf
5353
module "vault" {
5454
source = "registry.coder.com/coder/hcp-vault-secrets/coder"
55-
version = "1.0.33"
55+
version = "1.0.34"
5656
agent_id = coder_agent.example.id
5757
app_name = "demo-app"
5858
project_id = "aaa-bbb-ccc"
@@ -66,7 +66,7 @@ To fetch selective secrets from the HCP Vault Secrets app, set the `secrets` inp
6666
```tf
6767
module "vault" {
6868
source = "registry.coder.com/coder/hcp-vault-secrets/coder"
69-
version = "1.0.33"
69+
version = "1.0.34"
7070
agent_id = coder_agent.example.id
7171
app_name = "demo-app"
7272
project_id = "aaa-bbb-ccc"
@@ -81,7 +81,7 @@ Set `client_id` and `client_secret` as module inputs.
8181
```tf
8282
module "vault" {
8383
source = "registry.coder.com/coder/hcp-vault-secrets/coder"
84-
version = "1.0.33"
84+
version = "1.0.34"
8585
agent_id = coder_agent.example.id
8686
app_name = "demo-app"
8787
project_id = "aaa-bbb-ccc"

registry/coder/modules/jupyter-notebook/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A module that adds Jupyter Notebook in your Coder template.
1616
module "jupyter-notebook" {
1717
count = data.coder_workspace.me.start_count
1818
source = "registry.coder.com/coder/jupyter-notebook/coder"
19-
version = "1.1.1"
19+
version = "1.2.0"
2020
agent_id = coder_agent.example.id
2121
}
2222
```

registry/coder/modules/jupyter-notebook/main.tf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,27 @@ variable "group" {
4848
default = null
4949
}
5050

51+
variable "requirements_path" {
52+
type = string
53+
description = "The path to requirements.txt with packages to preinstall"
54+
default = ""
55+
}
56+
57+
variable "pip_install_extra_packages" {
58+
type = string
59+
description = "List of extra packages to preinstall (example: numpy==1.26.4 pandas matplotlib<4 scikit-learn)"
60+
default = ""
61+
}
62+
5163
resource "coder_script" "jupyter-notebook" {
5264
agent_id = var.agent_id
5365
display_name = "jupyter-notebook"
5466
icon = "/icon/jupyter.svg"
5567
script = templatefile("${path.module}/run.sh", {
5668
LOG_PATH : var.log_path,
57-
PORT : var.port
69+
PORT : var.port,
70+
REQUIREMENTS_PATH : var.requirements_path,
71+
PIP_INSTALL_EXTRA_PACKAGES : var.pip_install_extra_packages
5872
})
5973
run_on_start = true
6074
}

registry/coder/modules/jupyter-notebook/run.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ else
2020
echo "🥳 jupyter-notebook is already installed\n\n"
2121
fi
2222

23+
# Install packages selected with REQUIREMENTS_PATH
24+
if [ -n "${REQUIREMENTS_PATH}" ]; then
25+
if [ -f "${REQUIREMENTS_PATH}" ]; then
26+
echo "📄 Installing packages from ${REQUIREMENTS_PATH}..."
27+
pipx -q runpip notebook install -r "${REQUIREMENTS_PATH}"
28+
echo "🥳 Packages from ${REQUIREMENTS_PATH} have been installed\n\n"
29+
else
30+
echo "⚠️ REQUIREMENTS_PATH is set to '${REQUIREMENTS_PATH}' but the file does not exist!\n\n"
31+
fi
32+
fi
33+
34+
# Install packages selected with PIP_INSTALL_EXTRA_PACKAGES
35+
if [ -n "${PIP_INSTALL_EXTRA_PACKAGES}" ]; then
36+
echo "📦 Installing additional packages: ${PIP_INSTALL_EXTRA_PACKAGES}"
37+
pipx -q runpip notebook install ${PIP_INSTALL_EXTRA_PACKAGES}
38+
echo "🥳 Additional packages have been installed\n\n"
39+
fi
40+
2341
echo "👷 Starting jupyter-notebook in background..."
2442
echo "check logs at ${LOG_PATH}"
2543
$HOME/.local/bin/jupyter-notebook --NotebookApp.ip='0.0.0.0' --ServerApp.port=${PORT} --no-browser --ServerApp.token='' --ServerApp.password='' > ${LOG_PATH} 2>&1 &
23.3 KB
Loading

registry/ericpaulsen/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
display_name: "Eric Paulsen"
3+
bio: "Field CTO, EMEA @ Coder"
4+
avatar_url: "./.images/avatar.png"
5+
github: "ericpaulsen"
6+
linkedin: "https://www.linkedin.com/in/ericpaulsen17" # Optional
7+
website: "https://ericpaulsen.io" # Optional
8+
support_email: "[email protected]" # Optional
9+
status: "community"
10+
---
11+
12+
# Eric Paulsen
13+
14+
I'm Eric Paulsen, Coder's EMEA Field CTO based in London, originating from Miami.
15+
Outside of working with our customers, I enjoy teaching myself things,
16+
playing volleyball, and dabbling in a bit of DJing & photography.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
display_name: Kubernetes (Deployment) with Dynamic Username
3+
description: Provision Kubernetes Deployments as Coder workspaces with your Username
4+
icon: ../../../../.icons/kubernetes.svg
5+
verified: true
6+
tags: [kubernetes, container, username]
7+
---
8+
9+
# Remote development on Kubernetes with dynamic usernames
10+
11+
Provision Kubernetes Pods as [Coder workspaces](https://coder.com/docs/workspaces) with this example template. This template
12+
will run the workspace container as a non-root UID using your Coder username.
13+
14+
Here is the entrypoint logic in the template that enables Coder to source your username and write it to the Ubuntu operating system at start-up.
15+
16+
> These commands may differ if you run your workspace image with a distro other than Ubuntu.
17+
18+
```terraform
19+
command = ["sh", "-c", <<EOF
20+
# Create user and setup home directory
21+
sudo useradd ${data.coder_workspace_owner.me.name} --home=/home/${data.coder_workspace_owner.me.name} --shell=/bin/bash --uid=1001 --user-group
22+
sudo chown -R ${data.coder_workspace_owner.me.name}:${data.coder_workspace_owner.me.name} /home/${data.coder_workspace_owner.me.name}
23+
24+
# Switch to user and run agent
25+
exec sudo --preserve-env=CODER_AGENT_TOKEN -u ${data.coder_workspace_owner.me.name} sh -c '${coder_agent.main.init_script}'
26+
EOF
27+
]
28+
```
29+
30+
<!-- TODO: Add screenshot -->
31+
32+
## Prerequisites
33+
34+
### Infrastructure
35+
36+
**Cluster**: This template requires an existing Kubernetes cluster
37+
38+
**Container Image**: This template uses the [codercom/enterprise-base:ubuntu image](https://github.com/coder/enterprise-images/tree/main/images/base) with some dev tools preinstalled. To add additional tools, extend this image or build it yourself.
39+
40+
### Authentication
41+
42+
This template authenticates using a `~/.kube/config`, if present on the server, or via built-in authentication if the Coder provisioner is running on Kubernetes with an authorized ServiceAccount. To use another [authentication method](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#authentication), edit the template.
43+
44+
## Architecture
45+
46+
This template provisions the following resources:
47+
48+
- Kubernetes Deployment (ephemeral)
49+
- Kubernetes persistent volume claim (persistent on `/home/${username}`, where `${username}` is your Coder username)
50+
51+
This means, when the workspace restarts, any tools or files outside of the home directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the container image. Alternatively, individual developers can [personalize](https://coder.com/docs/dotfiles) their workspaces with dotfiles.

0 commit comments

Comments
 (0)