Skip to content

Week4 split dockerfiles #5

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

Merged
merged 7 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ logs/
__pycache__/
**/__pycache__/

Dockerfile
**/Dockerfile

.env
19 changes: 19 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import sys
import subprocess

def build_sqlancer():
subprocess.run(["docker", "build", "-t", "sqlancer:latest", "./sqlancer"], check=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect this can also be controled by cache or nocache


def build_db(dbms, version):
tag = f"{dbms}:{version}"
subprocess.run(["docker", "pull", tag], check=True)

if __name__ == "__main__":
cmd = sys.argv[1]
if cmd == "sqlancer":
build_sqlancer()
elif cmd == "db":
dbms = sys.argv[2]
version = sys.argv[4]
build_db(dbms, version)
9 changes: 8 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"dbms_list": ["mysql", "postgres"]
"dbms_list": ["mysql", "postgres"],
"dbms": "mysql",
"version": "custom",
"username": "root",
"password": "12345678",
"num_threads": 4,
"timeout_seconds": 60,
"oracle": "FUZZER"
}
39 changes: 0 additions & 39 deletions entrypoint.sh

This file was deleted.

67 changes: 0 additions & 67 deletions generate_dockerfile.py

This file was deleted.

22 changes: 14 additions & 8 deletions mysql/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"version": "8.0",
"username": "root",
"password": "12345678",
"num_threads": 4,
"timeout_seconds": 60,
"oracle": "FUZZER"
}

"image": "mysql:8.0",
"container_name": "mysql-test",
"port": 3306,
"env": {
"MYSQL_ROOT_PASSWORD": "12345678"
},
"username": "root",
"password": "12345678",
"oracle": "FUZZER",
"num_threads": 4,
"timeout_seconds": 60,
"init_sql": "CREATE DATABASE test;",
"init_sql_command": "docker exec {container_name} mysql -u{username} -p{password} -e \"{sql}\""
}
34 changes: 0 additions & 34 deletions mysql/docker_ops.py

This file was deleted.

6 changes: 0 additions & 6 deletions mysql/init.sql

This file was deleted.

18 changes: 13 additions & 5 deletions postgres/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{
"version": "12",
"image": "postgres:13",
"container_name": "postgres-test",
"port": 5432,
"env": {
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "12345678"
},
"username": "postgres",
"password": "12345678",
"num_threads": 2,
"timeout_seconds": 120,
"oracle": "QUERY_PARTITIONING"
}
"oracle": "NOREC",
"num_threads": 4,
"timeout_seconds": 60,
"init_sql": "CREATE DATABASE test;",
"init_sql_command_template": "psql -U {username} -c \"{sql}\""
}

33 changes: 0 additions & 33 deletions postgres/docker_ops.py

This file was deleted.

6 changes: 0 additions & 6 deletions postgres/init.sql

This file was deleted.

Loading