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

Added PowerShell scripts to support docker for Windows 10. #400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions docker/benchmarks/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t benchmarks -f Dockerfile ../../
9 changes: 9 additions & 0 deletions docker/benchmarks/run-client.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
docker run `
-d `
--log-opt max-size=10m `
--log-opt max-file=3 `
--name benchmarks-client `
-p 5002:5002 `
--restart always `
benchmarks `
dotnet run -c Debug --project src/BenchmarksClient/BenchmarksClient.csproj
26 changes: 26 additions & 0 deletions docker/benchmarks/run-server.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
param(
[string]$ServerIp="",
[string]$HardwareVersion="",
[string]$Hardware="",
[string]$Url="",
[string]$Name=""
)

$PostgreSql='--postgresql "Server=TFB-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;NoResetOnClose=true;Max Auto Prepare=3"'
$MySql='--mysql "Server=TFB-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;SslMode=None;ConnectionReset=false"'
$MsSql='--mssql "Server=TFB-database;Database=hello_world;User Id=sa;Password=Benchmarkdbp@55;Max Pool Size=100;"'
$MongoDb='--mongodb "mongodb://TFB-database:27017?maxPoolSize=1024"'

# "--network host" - Better performance than the default "bridge" driver
# "-v /var/run/docker.sock" - Give container access to the host docker daemon
docker run `
-d `
--log-opt max-size=10m `
--log-opt max-file=3 `
--name benchmarks-server `
-p 5001:5001 `
--restart always `
-v /var/run/docker.sock:/var/run/docker.sock `
benchmarks `
bash -c `
"dotnet run -c Debug --project src/BenchmarksServer/BenchmarksServer.csproj -n 10.0.75.0 --url http://*:5001 --hardware physical --hardware-version laptop"
2 changes: 2 additions & 0 deletions docker/benchmarks/stop-client.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker stop benchmarks-client
docker rm benchmarks-client
2 changes: 2 additions & 0 deletions docker/benchmarks/stop-server.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker stop benchmarks-server
docker rm benchmarks-server