JustATempest
JustATempest
Explore posts from servers
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
I'll see about writing up steps to reproduce
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
ok so I think this is what we are looking for
[ 315.136314] cloud-init[1235]: done.
[ 315.136440] cloud-init[1235]: #2: Taking snapshot of files...
[ 315.136520] cloud-init[1235]: 2024-09-23 19:24:14,928 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[ 315.136580] cloud-init[1235]: 2024-09-23 19:24:14,928 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.py'>) failed
[ 315.136314] cloud-init[1235]: done.
[ 315.136440] cloud-init[1235]: #2: Taking snapshot of files...
[ 315.136520] cloud-init[1235]: 2024-09-23 19:24:14,928 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[ 315.136580] cloud-init[1235]: 2024-09-23 19:24:14,928 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.py'>) failed
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
nevermind. Ingore this if you did not see the deleted message....
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
I run coder using docker compose. I'll send those logs as well as the logs from the container running on the EC2 instance. As soon as I gather them up.
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
That's the problem. It freezes on taking the snapshot step. Then I lose all connection on coder. Logging stops. I'm going to see if there's a flag I can add to pipe the logs from ENV builder into a file on the EC2 host.
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
Templates I'm using for reproducing the issue.
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
it's minimal and failing
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
this is the repo url for now
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
7e7fbc39-bbd9-467b-ba17-53f9a8b74d53
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
Sure ... I've been fighting for 4 hours today... I'll be taking a break today. Send it some time tomorrow.... 🥱
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
This
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
aws_ecr_repository auth error on EC2 envbuilder
resource "aws_ecr_repository" "cache_repo" {
name = "coder-${data.coder_workspace.me.id}-${data.coder_workspace.me.name}-cache"
tags = {
Coder_Provisioned = "true"
}
}

data "aws_ecr_authorization_token" "envbuilder_cache" {}

locals {
...
dockerconfig_json = jsonencode({
"auths" = {
"${aws_ecr_repository.cache_repo.repository_url}" = {
"auth" = data.aws_ecr_authorization_token.envbuilder_cache.authorization_token
}
}
})

envbuilder_env = {
"CODER_AGENT_TOKEN" = try(coder_agent.dev[0].token, "")
"CODER_AGENT_URL" = data.coder_workspace.me.access_url
"GIT_URL" = data.coder_parameter.repo_url.value
"FALLBACK_IMAGE" = "codercom/enterprise-base:ubuntu"
"ENVBUILDER_CACHE_REPO" = aws_ecr_repository.cache_repo.repository_url
"ENVBUILDER_PUSH_IMAGE" = 1
"AWS_SDK_LOAD_CONFIG" = true
"ENVBUILDER_DOCKER_CONFIG_BASE64" = base64encode(local.dockerconfig_json)
}

docker_env = [
for k, v in local.envbuilder_env : "${k}=${v}"
]

user_data = <<-EOT
...

# Create the necessary environment variables
ENV_VARS=$(
echo "${join(" ", [for k, v in local.envbuilder_env : "-e ${k}=${v}"])}"
)

# Start envbuilder
docker run --rm \
-h ${lower(data.coder_workspace.me.name)} \
-v /home/${local.linux_user}/envbuilder:/workspaces \
-e INIT_SCRIPT="echo ${base64encode(try(coder_agent.dev[0].init_script, ""))} | base64 -d | sh" \
$ENV_VARS \
ghcr.io/coder/envbuilder

...
EOT
}
resource "aws_ecr_repository" "cache_repo" {
name = "coder-${data.coder_workspace.me.id}-${data.coder_workspace.me.name}-cache"
tags = {
Coder_Provisioned = "true"
}
}

data "aws_ecr_authorization_token" "envbuilder_cache" {}

locals {
...
dockerconfig_json = jsonencode({
"auths" = {
"${aws_ecr_repository.cache_repo.repository_url}" = {
"auth" = data.aws_ecr_authorization_token.envbuilder_cache.authorization_token
}
}
})

envbuilder_env = {
"CODER_AGENT_TOKEN" = try(coder_agent.dev[0].token, "")
"CODER_AGENT_URL" = data.coder_workspace.me.access_url
"GIT_URL" = data.coder_parameter.repo_url.value
"FALLBACK_IMAGE" = "codercom/enterprise-base:ubuntu"
"ENVBUILDER_CACHE_REPO" = aws_ecr_repository.cache_repo.repository_url
"ENVBUILDER_PUSH_IMAGE" = 1
"AWS_SDK_LOAD_CONFIG" = true
"ENVBUILDER_DOCKER_CONFIG_BASE64" = base64encode(local.dockerconfig_json)
}

docker_env = [
for k, v in local.envbuilder_env : "${k}=${v}"
]

user_data = <<-EOT
...

# Create the necessary environment variables
ENV_VARS=$(
echo "${join(" ", [for k, v in local.envbuilder_env : "-e ${k}=${v}"])}"
)

# Start envbuilder
docker run --rm \
-h ${lower(data.coder_workspace.me.name)} \
-v /home/${local.linux_user}/envbuilder:/workspaces \
-e INIT_SCRIPT="echo ${base64encode(try(coder_agent.dev[0].init_script, ""))} | base64 -d | sh" \
$ENV_VARS \
ghcr.io/coder/envbuilder

...
EOT
}
6 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
aws_ecr_repository auth error on EC2 envbuilder
It's working here it's the fix for anyone in the future.
6 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
I'm using the latest docker compose version of coder
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
The devlogs above are the logs that I get.
30 replies
CCoder.com
Created by JustATempest on 9/19/2024 in #help
AWS EC2 (Devcontainer) fails with custom repo
30 replies
CCoder.com
Created by Phet(Dam) on 9/17/2024 in #help
what url callback in external auth ?
I believe you can just use your domain. The integration automatically changed to the correct URL for github.
13 replies
CCoder.com
Created by JustATempest on 9/14/2024 in #help
Github Single Sign On Unauthorized
This error happens when the pimary email don't match on github and coder
2 replies