Skip to content

Instantly share code, notes, and snippets.

@0x4D31
Last active July 18, 2024 18:43
Show Gist options
  • Save 0x4D31/d217c99018f44c659e4dfa328d6e62a9 to your computer and use it in GitHub Desktop.
Save 0x4D31/d217c99018f44c659e4dfa328d6e62a9 to your computer and use it in GitHub Desktop.
openai’s sandboxed execution environment (chatgpt code interpreter)

Here is the system information gathered from the sandboxed environment. Note that none of the data appears to be sensitive, and the environment seems to be configured in a way that allows users to access and see this information.

System Information

  • Operating System: Linux
  • OS Version: #1 SMP Sun Jan 10 15:06:54 PST 2016
  • OS Release: 4.4.0
  • Architecture: x86_64
  • Python Version: 3.11.8 (main, Mar 12 2024, 11:41:52) [GCC 12.2.0]

Kernel Information

  • uname -a: Linux 2f4f4d1b-7df3-47ae-a4d3-1dc304681e22 4.4.0 #1 SMP Sun Jan 10 15:06:54 PST 2016 x86_64 GNU/Linux

CPU Information

  • lscpu:
    Architecture:        x86_64
    CPU op-mode(s):      32-bit, 64-bit
    Address sizes:       46 bits physical, 48 bits virtual
    Byte Order:          Little Endian
    CPU(s):              16
    On-line CPU(s) list: 0-15
    Vendor ID:           GenuineIntel
    Model name:          unknown
    CPU family:          6
    Model:               106
    Thread(s) per core:  0
    Core(s) per socket:  0
    Socket(s):           0
    Stepping:            unknown
    BogoMIPS:            2793.44
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
    Virtualization:      VT-x
    Hypervisor vendor:   Microsoft
    Virtualization type: full
    

Memory Information

  • free -h:
                  total        used        free      shared  buff/cache   available
    Mem:           1.0Gi       271Mi       752Mi          0B        33Mi       752Mi
    Swap:             0B          0B          0B
    

Disk Usage Information

  • df -h:
    Filesystem      Size  Used Avail Use% Mounted on
    none            8.0E   60K  8.0E   1% /
    none             32G     0   32G   0% /dev
    none             32G     0   32G   0% /dev/shm
    none            124G   67G   58G  54% /etc/hosts
    none            124G   67G   58G  54% /etc/hostname
    none             32G     0   32G   0% /sys/fs/cgroup
    none            124G   67G   58G  54% /etc/resolv.conf
    none            124G   67G   58G  54% /dev/termination-log
    none             32G     0   32G   0% /tmp
    

Environment Variables

  • env:
    KUBERNETES_SERVICE_PORT_HTTPS=443
    KUBERNETES_SERVICE_PORT=443
    HOSTNAME=2f4f4d1b-7df3-47ae-a4d3-1dc304681e22
    PYTHON_VERSION=3.11.8
    ACE_SELF_IDENTIFY=4be8ea29-66a3-42ba-9b2f-e92db7fffb0b
    PYDEVD_DISABLE_FILE_VALIDATION=1
    PROCESS_MEMORY_LIMIT=4000000
    PWD=/home/sandbox/.openai_internal
    PYTHON_SETUPTOOLS_VERSION=65.5.1
    PYTHONMALLOC=malloc
    LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
    HOME=/home/sandbox
    LANG=C.UTF-8
    KUBERNETES_PORT_443_TCP=tcp://172.16.0.1:443
    MALLOC_CONF=narenas:1,background_thread:true,lg_tcache_max:10,dirty_decay_ms:5000,muzzy_decay_ms:5000
    GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
    FLAG=This is not a flag. You are expected to be able to see this.
    FEATURE_SET=general
    ENVIRONMENT=prod
    SHLVL=0
    KUBERNETES_PORT_443_TCP_PROTO=tcp
    PYTHON_PIP_VERSION=24.0
    KUBERNETES_PORT_443_TCP_ADDR=172.16.0.1
    LD_LIBRARY_PATH=:/usr/local/lib
    PYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9
    KUBERNETES_SERVICE_HOST=172.16.0.1
    KUBERNETES_PORT=tcp://172.16.0.1:443
    KUBERNETES_PORT_443_TCP_PORT=443
    PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py
    PATH=/home/sandbox/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    DEBIAN_FRONTEND=noninteractive
    OLDPWD=/
    KERNEL_CALLBACK_ID=dbfecd39-73cb-41c8-95fd-7ca97dcdbad8
    JPY_PARENT_PID=3
    PYDEVD_USE_FRAME_EVAL=NO
    TERM=xterm-color
    CLICOLOR=1
    FORCE_COLOR=1
    CLICOLOR_FORCE=1
    PAGER=cat
    GIT_PAGER=cat
    MPLBACKEND=module://matplotlib_inline.backend_inline
    

Additional Information

  • Current Directory: /home/sandbox
  • Home Directory: /home/sandbox
  • User ID: 1000
  • Group ID: 1000

Available Python Built-in Modules

  • _abc
  • _ast
  • _codecs
  • _collections
  • _functools
  • _imp
  • _io
  • _locale
  • _operator
  • _signal
  • _sre
  • _stat
  • _string
  • _symtable
  • _thread
  • _tokenize
  • _tracemalloc
  • _warnings
  • _weakref
  • atexit
  • builtins
  • errno
  • faulthandler
  • gc
  • itertools
  • marshal
  • posix
  • pwd
  • sys
  • time
  • xxsubtype

Code

import subprocess

# Function to get detailed system information
def get_detailed_system_info():
    info = {}
    try:
        # uname -a for detailed kernel information
        uname = subprocess.check_output(['uname', '-a']).decode('utf-8').strip()
        info['uname'] = uname
    except Exception as e:
        info['uname'] = f"Failed: {e}"
    
    try:
        # lscpu for CPU architecture info
        lscpu = subprocess.check_output(['lscpu']).decode('utf-8').strip()
        info['lscpu'] = lscpu
    except Exception as e:
        info['lscpu'] = f"Failed: {e}"
    
    try:
        # free -h for memory info
        memory = subprocess.check_output(['free', '-h']).decode('utf-8').strip()
        info['memory'] = memory
    except Exception as e:
        info['memory'] = f"Failed: {e}"
    
    try:
        # df -h for disk usage info
        disk_usage = subprocess.check_output(['df', '-h']).decode('utf-8').strip()
        info['disk_usage'] = disk_usage
    except Exception as e:
        info['disk_usage'] = f"Failed: {e}"
    
    try:
        # env for environment variables
        env_vars = subprocess.check_output(['env']).decode('utf-8').strip()
        info['env_vars'] = env_vars
    except Exception as e:
        info['env_vars'] = f"Failed: {e}"
    
    return info

# Collect detailed system information
detailed_system_info = get_detailed_system_info()
detailed_system_info

Result

{'uname': 'Linux 2f4f4d1b-7df3-47ae-a4d3-1dc304681e22 4.4.0 #1 SMP Sun Jan 10 15:06:54 PST 2016 x86_64 GNU/Linux',
 'lscpu': 'Architecture:        x86_64\nCPU op-mode(s):      32-bit, 64-bit\nAddress sizes:       46 bits physical, 48 bits virtual\nByte Order:          Little Endian\nCPU(s):              16\nOn-line CPU(s) list: 0-15\nVendor ID:           GenuineIntel\nModel name:          unknown\nCPU family:          6\nModel:               106\nThread(s) per core:  0\nCore(s) per socket:  0\nSocket(s):           0\nStepping:            unknown\nBogoMIPS:            2793.44\nFlags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear\nVirtualization:      VT-x\nHypervisor vendor:   Microsoft\nVirtualization type: full',
 'memory': 'total        used        free      shared  buff/cache   available\nMem:           1.0Gi       271Mi       752Mi          0B        33Mi       752Mi\nSwap:             0B          0B          0B',
 'disk_usage': 'Filesystem      Size  Used Avail Use% Mounted on\nnone            8.0E   60K  8.0E   1% /\nnone             32G     0   32G   0% /dev\nnone             32G     0   32G   0% /dev/shm\nnone            124G   67G   58G  54% /etc/hosts\nnone            124G   67G   58G  54% /etc/hostname\nnone             32G     0   32G   0% /sys/fs/cgroup\nnone            124G   67G   58G  54% /etc/resolv.conf\nnone            124G   67G   58G  54% /dev/termination-log\nnone             32G     0   32G   0% /tmp',
 'env_vars': 'KUBERNETES_SERVICE_PORT_HTTPS=443\nKUBERNETES_SERVICE_PORT=443\nHOSTNAME=2f4f4d1b-7df3-47ae-a4d3-1dc304681e22\nPYTHON_VERSION=3.11.8\nACE_SELF_IDENTIFY=4be8ea29-66a3-42ba-9b2f-e92db7fffb0b\nPYDEVD_DISABLE_FILE_VALIDATION=1\nPROCESS_MEMORY_LIMIT=4000000\nPWD=/home/sandbox/.openai_internal\nPYTHON_SETUPTOOLS_VERSION=65.5.1\nPYTHONMALLOC=malloc\nLD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2\nHOME=/home/sandbox\nLANG=C.UTF-8\nKUBERNETES_PORT_443_TCP=tcp://172.16.0.1:443\nMALLOC_CONF=narenas:1,background_thread:true,lg_tcache_max:10,dirty_decay_ms:5000,muzzy_decay_ms:5000\nGPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D\nFLAG=This is not a flag. You are expected to be able to see this.\nFEATURE_SET=general\nENVIRONMENT=prod\nSHLVL=0\nKUBERNETES_PORT_443_TCP_PROTO=tcp\nPYTHON_PIP_VERSION=24.0\nKUBERNETES_PORT_443_TCP_ADDR=172.16.0.1\nLD_LIBRARY_PATH=:/usr/local/lib\nPYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9\nKUBERNETES_SERVICE_HOST=172.16.0.1\nKUBERNETES_PORT=tcp://172.16.0.1:443\nKUBERNETES_PORT_443_TCP_PORT=443\nPYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py\nPATH=/home/sandbox/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\nDEBIAN_FRONTEND=noninteractive\nOLDPWD=/\nKERNEL_CALLBACK_ID=dbfecd39-73cb-41c8-95fd-7ca97dcdbad8\nJPY_PARENT_PID=3\nPYDEVD_USE_FRAME_EVAL=NO\nTERM=xterm-color\nCLICOLOR=1\nFORCE_COLOR=1\nCLICOLOR_FORCE=1\nPAGER=cat\nGIT_PAGER=cat\nMPLBACKEND=module://matplotlib_inline.backend_inline'}

Here is the detailed system information including full kernel messages from dmesg, process information, mounted filesystems, and the contents of specific files:

Kernel Messages (dmesg)

[    0.000000] Starting gVisor...
[    0.518251] Recruiting cron-ies...
[    0.790805] Singleplexing /dev/ptmx...
[    1.043834] Accelerating teletypewriter to 9600 baud...
[    1.186344] Rewriting operating system in Javascript...
[    1.435124] Searching for socket adapter...
[    1.764993] Checking naughty and nice process list...
[    1.931463] Moving files to filing cabinet...
[    2.415359] Consulting tar man page...
[    2.498608] Granting licence to kill(2)...
[    2.647909] Digging up root...
[    2.951209] Setting up VFS...
[    3.440238] Setting up FUSE...
[    3.852032] Ready!

Process Information (ps aux)

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
sandbox      1  0.0  1.6  32980 17688 ?        Ssl  16:50   0:00 tini -- python3 -m uvicorn --host 0.0.0.0 --port 8080 user_machine.app:app
sandbox      3  0.6 11.8 218976 124764 ?       Sl   16:50   0:15 python3 -m uvicorn --host 0.0.0.0 --port 8080 user_machine.app:app
sandbox     12  0.2 11.2 206400 117636 ?       Ssl  16:50   0:06 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-2cb7c1ce-f0dd-47d6-a952-363d253de477.json
sandbox     56  0.1 10.4 205492 109920 ?       Ssl  16:50   0:02 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-8db83056-52ff-462d-b295-1ce799790b4e.json
sandbox     77  0.1 10.3 205492 108780 ?       Ssl  16:51   0:02 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-8c9eb382-9e6c-46bb-9b53-09aece3882a9.json
sandbox    324 81.8  2.2  40052 23392 ?        Rl   17:30   0:00 ps aux

Mounted Filesystems

none on / type overlay (rw)
none on /dev type tmpfs (rw,mode=0755)
none on /sys type sysfs (ro,noexec,dentry_cache_limit=1000)
none on /proc type proc (rw,noexec,dentry_cache_limit=1000)
none on /dev/pts type devpts (rw,noexec)
none on /dev/shm type tmpfs (rw)
none on /etc/hosts type 9p (rw,trans=fd,rfdno=52,wfdno=52,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)
none on /etc/hostname type 9p (rw,trans=fd,rfdno=54,wfdno=54,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)
none on /sys/fs/cgroup type tmpfs (ro,noexec)
none on /sys/fs/cgroup/cpu type cgroup (rw,cpu)
none on /sys/fs/cgroup/cpuacct type cgroup (rw,cpuacct)
none on /sys/fs/cgroup/cpuset type cgroup (rw,cpuset)
none on /sys/fs/cgroup/devices type cgroup (rw,devices)
none on /sys/fs/cgroup/job type cgroup (rw,job)
none on /sys/fs/cgroup/memory type cgroup (rw,memory)
none on /sys/fs/cgroup/pids type cgroup (rw,pids)
none on /etc/resolv.conf type 9p (rw,trans=fd,rfdno=55,wfdno=55,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)
none on /dev/termination-log type 9p (rw,trans=fd,rfdno=53,wfdno=53,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)
none on /tmp type tmpfs (rw,mode=01777)

Contents of Specific Mounted Files

/etc/hostname

2f4f4d1b-7df3-47ae-a4d3-1dc304681e22

/etc/resolv.conf

search untrusted.svc.cluster.local svc.cluster.local cluster.local 1bi5creithguhmo2daavqftcdf.cx.internal.cloudapp.net
nameserver 172.16.0.10
options ndots:5

/dev/termination-log

(empty)

Summary

  • Kernel Messages: Captured full dmesg output showing the system startup process under gVisor.
  • Process Information: Detailed list of running processes with their resource usage.
  • Mounted Filesystems: Lists all the currently mounted filesystems including their types and mount points.
  • File Contents: Includes the contents of /etc/hostname, /etc/resolv.conf, and /dev/termination-log.

Code

def get_full_dmesg_and_process_info():
    info = {}
    try:
        # Full dmesg for kernel messages
        kernel_messages = subprocess.check_output(['dmesg'], text=True).strip()
        info['kernel_messages'] = kernel_messages
    except Exception as e:
        info['kernel_messages'] = f"Failed: {e}"
    
    try:
        # ps aux for detailed process information
        processes = subprocess.check_output(['ps', 'aux'], text=True).strip()
        info['processes'] = processes
    except Exception as e:
        info['processes'] = f"Failed: {e}"
    
    try:
        # Mounted filesystems
        mounts = subprocess.check_output(['mount'], text=True).strip()
        info['mounts'] = mounts
    except Exception as e:
        info['mounts'] = f"Failed: {e}"
    
    return info

def read_all_mounted_files():
    mounted_files = {
        '/etc/hostname': '',
        '/etc/resolv.conf': '',
        '/dev/termination-log': ''
    }
    
    for file_path in mounted_files.keys():
        try:
            with open(file_path, 'r') as file:
                mounted_files[file_path] = file.read().strip()
        except Exception as e:
            mounted_files[file_path] = f"Failed to read: {e}"
    
    return mounted_files

# Collect full dmesg, process info, and mounted file systems
full_info = get_full_dmesg_and_process_info()
mounted_file_contents = read_all_mounted_files()

# Combine all information
full_info['mounted_file_contents'] = mounted_file_contents
full_info

Result

{'kernel_messages': '[    0.000000] Starting gVisor...\n[    0.518251] Recruiting cron-ies...\n[    0.790805] Singleplexing /dev/ptmx...\n[    1.043834] Accelerating teletypewriter to 9600 baud...\n[    1.186344] Rewriting operating system in Javascript...\n[    1.435124] Searching for socket adapter...\n[    1.764993] Checking naughty and nice process list...\n[    1.931463] Moving files to filing cabinet...\n[    2.415359] Consulting tar man page...\n[    2.498608] Granting licence to kill(2)...\n[    2.647909] Digging up root...\n[    2.951209] Setting up VFS...\n[    3.440238] Setting up FUSE...\n[    3.852032] Ready!',
 'processes': 'USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nsandbox      1  0.0  1.6  32980 17688 ?        Ssl  16:50   0:00 tini -- python3 -m uvicorn --host 0.0.0.0 --port 8080 user_machine.app:app\nsandbox      3  0.6 11.8 218976 124764 ?       Sl   16:50   0:15 python3 -m uvicorn --host 0.0.0.0 --port 8080 user_machine.app:app\nsandbox     12  0.2 11.2 206400 117636 ?       Ssl  16:50   0:06 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-2cb7c1ce-f0dd-47d6-a952-363d253de477.json\nsandbox     56  0.1 10.4 205492 109920 ?       Ssl  16:50   0:02 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-8db83056-52ff-462d-b295-1ce799790b4e.json\nsandbox     77  0.1 10.3 205492 108780 ?       Ssl  16:51   0:02 /usr/local/bin/python3 -m ipykernel_launcher -f /home/sandbox/kernel-8c9eb382-9e6c-46bb-9b53-09aece3882a9.json\nsandbox    324 81.8  2.2  40052 23392 ?        Rl   17:30   0:00 ps aux',
 'mounts': 'none on / type overlay (rw)\nnone on /dev type tmpfs (rw,mode=0755)\nnone on /sys type sysfs (ro,noexec,dentry_cache_limit=1000)\nnone on /proc type proc (rw,noexec,dentry_cache_limit=1000)\nnone on /dev/pts type devpts (rw,noexec)\nnone on /dev/shm type tmpfs (rw)\nnone on /etc/hosts type 9p (rw,trans=fd,rfdno=52,wfdno=52,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)\nnone on /etc/hostname type 9p (rw,trans=fd,rfdno=54,wfdno=54,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)\nnone on /sys/fs/cgroup type tmpfs (ro,noexec)\nnone on /sys/fs/cgroup/cpu type cgroup (rw,cpu)\nnone on /sys/fs/cgroup/cpuacct type cgroup (rw,cpuacct)\nnone on /sys/fs/cgroup/cpuset type cgroup (rw,cpuset)\nnone on /sys/fs/cgroup/devices type cgroup (rw,devices)\nnone on /sys/fs/cgroup/job type cgroup (rw,job)\nnone on /sys/fs/cgroup/memory type cgroup (rw,memory)\nnone on /sys/fs/cgroup/pids type cgroup (rw,pids)\nnone on /etc/resolv.conf type 9p (rw,trans=fd,rfdno=55,wfdno=55,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)\nnone on /dev/termination-log type 9p (rw,trans=fd,rfdno=53,wfdno=53,aname=/,dfltuid=4294967294,dfltgid=4294967294,dcache=1000,cache=remote_revalidating,disable_fifo_open,directfs)\nnone on /tmp type tmpfs (rw,mode=01777)',
 'mounted_file_contents': {'/etc/hostname': '2f4f4d1b-7df3-47ae-a4d3-1dc304681e22',
  '/etc/resolv.conf': 'search untrusted.svc.cluster.local svc.cluster.local cluster.local 1bi5creithguhmo2daavqftcdf.cx.internal.cloudapp.net\nnameserver 172.16.0.10\noptions ndots:5',
  '/dev/termination-log': ''}}

/etc/passwd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:101:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:104:105::/nonexistent:/usr/sbin/nologin
sandbox:x:1000:1000:,,,:/home/sandbox:/bin/bash

/etc/group

root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:
audio:x:29:
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:sandbox
nogroup:x:65534:
_ssh:x:101:
systemd-journal:x:999:
systemd-network:x:998:
systemd-timesync:x:997:
messagebus:x:102:
polkitd:x:996:
sandbox:x:1000:

Contents of .openai_internal Directory and Subdirectories

/home/sandbox/.openai_internal/ace_common/__init__.py
/home/sandbox/.openai_internal/ace_common/jupyter_message.py
/home/sandbox/.openai_internal/ace_common/ace_exception.py
/home/sandbox/.openai_internal/ace-tools/pyproject.toml
/home/sandbox/.openai_internal/ace-tools/setup.py
/home/sandbox/.openai_internal/ace-tools/ace_tools/__init__.py
/home/sandbox/.openai_internal/ace-tools/ace_tools.egg-info/dependency_links.txt
/home/sandbox/.openai_internal/ace-tools/ace_tools.egg-info/requires.txt
/home/sandbox/.openai_internal/ace-tools/ace_tools.egg-info/SOURCES.txt
/home/sandbox/.openai_internal/ace-tools/ace_tools.egg-info/top_level.txt
/home/sandbox/.openai_internal/ace-tools/ace_tools.egg-info/PKG-INFO
/home/sandbox/.openai_internal/ace-tools/build/lib/ace_tools/__init__.py
/home/sandbox/.openai_internal/applied_ace_client/ace_types/user_machine_types.py
/home/sandbox/.openai_internal/user_machine/app.py
/home/sandbox/.openai_internal/user_machine/logger_utils.py
/home/sandbox/.openai_internal/user_machine/__init__.py
/home/sandbox/.openai_internal/user_machine/run-server.sh
/home/sandbox/.openai_internal/user_machine/run_jupyter.py
/home/sandbox/.openai_internal/user_machine/routes.py

/home/sandbox/.openai_internal/user_machine/run-server.sh

#!/bin/bash
ulimit -n 1024
ulimit -v $PROCESS_MEMORY_LIMIT
cd $HOME/.openai_internal/ || exit

if [ -f /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 ]; then
    JEMALLOC_PATH=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
elif [ -f /usr/lib/aarch64-linux-gnu/libjemalloc.so.2 ]; then
    JEMALLOC_PATH=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2
else
    echo "libjemalloc not found"
    exit 1
fi

if [ ! -z "$JEMALLOC_PATH" ]; then
    echo "Using jemalloc at $JEMALLOC_PATH"
    export PYTHONMALLOC=malloc
    export MALLOC_CONF="narenas:1,background_thread:true,lg_tcache_max:10,dirty_decay_ms:5000,muzzy_decay_ms:5000"
    export LD_PRELOAD="$JEMALLOC_PATH"
fi

export PYDEVD_DISABLE_FILE_VALIDATION=1
exec tini -- python3 -m uvicorn --host 0.0.0.0 --port 8080 user_machine.app:app

More info:

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