Update AWS AMI ID, enhance directory creation logic in file upload, modify osworld service configuration, and refine JSON evaluation examples for improved clarity and functionality.
This commit is contained in:
@@ -36,7 +36,7 @@ DEFAULT_REGION = "us-east-1"
|
|||||||
# todo: Add doc for the configuration of image, security group and network interface
|
# todo: Add doc for the configuration of image, security group and network interface
|
||||||
# todo: public the AMI images
|
# todo: public the AMI images
|
||||||
IMAGE_ID_MAP = {
|
IMAGE_ID_MAP = {
|
||||||
"us-east-1": "ami-0cae20d2680c939d4",
|
"us-east-1": "ami-0a6a55a75d04c8888",
|
||||||
"ap-east-1": "ami-0c092a5b8be4116f5",
|
"ap-east-1": "ami-0c092a5b8be4116f5",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1161,7 +1161,9 @@ def upload_file():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Ensure target directory exists
|
# Ensure target directory exists
|
||||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
target_dir = os.path.dirname(file_path)
|
||||||
|
if target_dir: # Only create directory if it's not empty
|
||||||
|
os.makedirs(target_dir, exist_ok=True)
|
||||||
|
|
||||||
# Save file and get size for verification
|
# Save file and get size for verification
|
||||||
file.save(file_path)
|
file.save(file_path)
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OSWorld Server
|
Description=osworld service
|
||||||
StartLimitIntervalSec=60
|
StartLimitIntervalSec=60
|
||||||
StartLimitBurst=4
|
StartLimitBurst=4
|
||||||
After=network.target auditd.service
|
After=network.target auditd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/python3 /home/user/main.py
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/python /home/user/server/main.py
|
||||||
User=user
|
User=user
|
||||||
WorkingDirectory=/home/user
|
WorkingDirectory=/home/user
|
||||||
|
Environment="DISPLAY=:0"
|
||||||
|
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
|
||||||
|
Environment="XDG_RUNTIME_DIR=/run/user/1000"
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=1
|
RestartSec=5s
|
||||||
Environment="DISPLAY=:1"
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=graphical.target
|
WantedBy=multi-user.target
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"parameters": {
|
"parameters": {
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"url": "https://huggingface.co/datasets/xlangai/ubuntu_osworld_file_cache/resolve/main/os/37887e8c-da15-4192-923c-08fa390a176d/eval.sh",
|
"url": "https://huggingface.co/datasets/xlangai/ubuntu_osworld_file_cache/resolve/main/os/37887e8c-da15-4192-923c-08fa390a176d/eval_20250703.sh",
|
||||||
"path": "eval.sh"
|
"path": "eval.sh"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -20,25 +20,49 @@
|
|||||||
"os"
|
"os"
|
||||||
],
|
],
|
||||||
"evaluator": {
|
"evaluator": {
|
||||||
"func": "check_include_exclude",
|
"func": [
|
||||||
"result": {
|
"check_include_exclude",
|
||||||
"type": "vm_command_line",
|
"check_include_exclude"
|
||||||
"command": "LARGE_TEXT=$(gsettings get org.gnome.desktop.interface text-scaling-factor 2>/dev/null | grep -E '1\\.[2-9]|[2-9]\\.' | wc -l) && ZOOM_ENABLED=$(gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled 2>/dev/null | grep -c true) && ZOOM_FACTOR=$(gsettings get org.gnome.desktop.a11y.magnifier mag-factor 2>/dev/null | grep -E '[2-9]\\.|1\\.[1-9]' | wc -l) && if [ \"$LARGE_TEXT\" -gt 0 ]; then echo \"Large text enabled\"; elif [ \"$ZOOM_ENABLED\" -gt 0 ] && [ \"$ZOOM_FACTOR\" -gt 0 ]; then echo \"Zoom enabled with magnification\"; else echo \"No enlargement enabled\"; fi",
|
],
|
||||||
"shell": true
|
"conj": "or",
|
||||||
},
|
"result": [
|
||||||
"expected": {
|
{
|
||||||
"type": "rule",
|
"type": "vm_command_line",
|
||||||
"rules": {
|
"command": "TEXT_SCALE=$(timeout 10 gsettings get org.gnome.desktop.interface text-scaling-factor 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+' | head -1); if [ -n \"$TEXT_SCALE\" ] && [ \"$(echo \"$TEXT_SCALE >= 1.2\" | bc -l 2>/dev/null || echo 0)\" = \"1\" ]; then echo \"Large text enabled (factor: $TEXT_SCALE)\"; else echo \"No text scaling enabled\"; fi",
|
||||||
"include": [
|
"shell": true
|
||||||
"Large text enabled",
|
},
|
||||||
"Zoom enabled with magnification"
|
{
|
||||||
],
|
"type": "vm_command_line",
|
||||||
"exclude": [
|
"command": "ZOOM_ENABLED=$(timeout 10 gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled 2>/dev/null | grep -c true); ZOOM_FACTOR=$(timeout 10 gsettings get org.gnome.desktop.a11y.magnifier mag-factor 2>/dev/null | grep -oE '[0-9]+\\.[0-9]+' | head -1); if [ \"$ZOOM_ENABLED\" -gt 0 ] && [ -n \"$ZOOM_FACTOR\" ] && [ \"$(echo \"$ZOOM_FACTOR > 1.1\" | bc -l 2>/dev/null || echo 0)\" = \"1\" ]; then echo \"Zoom enabled with magnification (factor: $ZOOM_FACTOR)\"; else echo \"No zoom magnification enabled\"; fi",
|
||||||
"No enlargement enabled",
|
"shell": true
|
||||||
"error"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
|
"expected": [
|
||||||
|
{
|
||||||
|
"type": "rule",
|
||||||
|
"rules": {
|
||||||
|
"include": [
|
||||||
|
"Large text enabled"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"No text scaling enabled",
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "rule",
|
||||||
|
"rules": {
|
||||||
|
"include": [
|
||||||
|
"Zoom enabled with magnification"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"No zoom magnification enabled",
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"proxy": false
|
"proxy": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user