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

chore(MsSql): Update MSSQL image workaround #426

Merged
merged 1 commit into from
Aug 22, 2023
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
1 change: 0 additions & 1 deletion Equinox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".project", ".project", "{7E
global.json = global.json
nuget.config = nuget.config
docker-compose-cosmos.sh = docker-compose-cosmos.sh
docker-compose-mssql.sh = docker-compose-mssql.sh
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Domain", "samples\Store\Domain\Domain.fsproj", "{37B4A45F-039E-4515-8A84-D242DDE12D22}"
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,16 +685,6 @@ NOTE Have not tested with the Windows Emulator, but it should work with analogou

There's a `docker-compose.yml` file in the root, so installing `docker-compose` and then running `docker-compose up` rigs local `equinox-mssql`, `equinox-mysql` and `equinox-postgres` servers and databases at known ports. _NOTE The `Equinox.SqlStreamStore.*.Integration` suites currently assume this is in place and will otherwise fail_.

<a name="provisioning-mssql"></a>
### Provisioning `mcr.microsoft.com/mssql/server:2019-latest` for `SqlStreamStore.MsSql`

Until https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1059819719 is resolved (see [#315](https://github.com/jet/equinox/pull/315), after the `docker compose up` one needs to manually:

docker compose up equinox-mssql
bash docker-compose-mssql.sh

(PRs welcome to automate the hack, but ideally the image will allow parameterizing it as handled by the Postgres and MySql images when common sense prevails re [`mssql-docker#2`](https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1059819719))

## DEPROVISIONING

### Deprovisioning (aka nuking) EventStore data resulting from tests to reset baseline
Expand Down
5 changes: 0 additions & 5 deletions docker-compose-mssql.sh

This file was deleted.

11 changes: 8 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ services:
- "8081:8081" # so docker-cosmos-init.sh can get the cert and/or humans can use https://localhost:8081/_explorer/index.html
- "10250-10256:10250-10256" # tests connect using Direct mode

# NOTE MANUAL STEP until MS get with the program https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1059819719
# after `docker compose up`, run `bash docker-compose-mssql.sh`
equinox-mssql:
container_name: equinox-mssql
image: mcr.microsoft.com/mssql/server:2019-latest
image: mcr.microsoft.com/mssql/server:2022-latest
restart: unless-stopped
ports:
- 1433:1433
environment:
- SA_PASSWORD=mssql1Ipw
- ACCEPT_EULA=Y
# see https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1683956282
equinox-mssql-init:
image: mcr.microsoft.com/mssql/server:2022-latest
network_mode: service:equinox-mssql
command: bash -c 'until /opt/mssql-tools/bin/sqlcmd -U sa -P mssql1Ipw -Q "CREATE DATABASE EQUINOX_TEST_DB"; do echo retry && sleep 1; done'
depends_on:
- equinox-mssql

equinox-mysql:
container_name: equinox-mysql
Expand Down
3 changes: 0 additions & 3 deletions tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ open Equinox.SqlStreamStore.MsSql
let connectToLocalStore (_: Serilog.ILogger) =
Connector("Server=localhost,1433;User=sa;Password=mssql1Ipw;Database=EQUINOX_TEST_DB", autoCreate = true).Establish()

(* WORKAROUND FOR https://github.com/microsoft/mssql-docker/issues/2#issuecomment-1059819719
AFTER `docker compose up`, run `bash docker-compose-mssql.sh` *)

type Context = SqlStreamStoreContext
type Category<'event, 'state, 'context> = SqlStreamStoreCategory<'event, 'state, 'context>
#endif
Expand Down
Loading