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

Workspace ID inconsistency #1600

Open
castorinop opened this issue Jan 27, 2025 · 4 comments
Open

Workspace ID inconsistency #1600

castorinop opened this issue Jan 27, 2025 · 4 comments

Comments

@castorinop
Copy link

What happened?
i want add extra arg name with the value workspace id for docker instance but apears de uid value.

docker inspect instance:

[
    {
        "Id": "4497d1ca6f28bb0cac765f121a0b227f18932a82b55d330d16288e0c36923dfc",
        "Created": "2025-01-27T16:28:37.206014139Z",
        ... 
        "Name": "/default-st-45dc4_devpod",
        ...
        "Config": {
            "Hostname": "4497d1ca6f28",
            "Domainname": "",
            "User": "ftuser",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "REMOTE_CONTAINERS=true",
                "DEVPOD_WORKSPACE_ID=workspacename",
                "DEVPOD_WORKSPACE_UID=default-st-45dc4",
                "DEVPOD=true",
                ...
            ],
        }
    }
]

What did you expect to happen instead?

The name of instance should be workspacename_devpod.

for uid should be ${devcontainerUid}, right?

How can we reproduce the bug? (as minimally and precisely as possible)

My devcontainer.json:

{
    "name": "...",
    "runArgs": ["--name", "${devcontainerId}_devpod"],
}

Local Environment:

  • DevPod Version: v0.6.9
  • Operating System: linux
  • ARCH of the OS: AMD64
@castorinop castorinop changed the title Workspace ID inconistency Workspace ID inconsistency Jan 27, 2025
@bkneis
Copy link
Contributor

bkneis commented Jan 28, 2025

Hey @castorinop thanks for raising your issue! The docker ID should not be the devcontainer UID, this is an ID docker uses and can not be set with docker run. The name could be set to the workspacename with _devpod, I am not sure why the runArgs did not work as expected so I will take a look into this

@bkneis
Copy link
Contributor

bkneis commented Jan 28, 2025

Hey @castorinop I just tested with your example and it worked for me :/ My docker container came up with the correct name. Just to verify your using the docker provider? and also when you used ${devcontainerId}_devpod this was not literal? but you replaced ${devcontainerId}? I don't think this is a variable that we extrapolate

@castorinop
Copy link
Author

@bkneis, im using docker provider.

devpod provider list
  
     NAME  | VERSION | DEFAULT | INITIALIZED |   DESCRIPTION     
  ---------+---------+---------+-------------+-------------------
    docker | v0.0.1  | true    | true        | DevPod on Docker  
  

docker version: 27.4.1

in this example:

  • witch value is correct for devcontainerId ? "workspace" right ?
  • env vars show "DEVPOD_WORKSPACE_ID=workspace", "DEVPOD_WORKSPACE_UID=default-st-45dc4",

ahother tests:

  • tested with "runArgs": ["--name", "test"]

docker inspect test

[
    {
        "Id": "02afa2f4cd9c49519a75047cc7e8e36a372fe408f3f7d3dbad495a01ed9039db",
        "Name": "/test",
            "Env": [
                "DEVPOD=true",
                "REMOTE_CONTAINERS=true",
                "DEVPOD_WORKSPACE_ID=workspace",
                "DEVPOD_WORKSPACE_UID=default-st-45dc4",
               ],
            ...            }
        }
    }
]

  • tested with "runArgs": ["--name", "${devcontainerId}"]

docker inspect default-st-45dc4

[
    {
        "Id": "02afa2f4cd9c49519a75047cc7e8e36a372fe408f3f7d3dbad495a01ed9039db",
        "Name": "/default-st-45dc4",
            "Env": [
                "DEVPOD=true",
                "REMOTE_CONTAINERS=true",
                "DEVPOD_WORKSPACE_ID=workspace",
                "DEVPOD_WORKSPACE_UID=default-st-45dc4",
               ],
            ...            }
        }
    }
]

@castorinop
Copy link
Author

@bkneis i wrote a test to verify. can you try it ?

https://gist.github.com/castorinop/22340c83cecf17520983b382a60b8e60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants