Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/grai-server/app/cryptograph…
Browse files Browse the repository at this point in the history
…y-43.0.1
  • Loading branch information
ieaves authored Oct 17, 2024
2 parents ca2e22d + 8e12fec commit b072da0
Show file tree
Hide file tree
Showing 10 changed files with 1,067 additions and 1,036 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/integration-mssql-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,23 @@ jobs:
env:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: ${{ env.DB_PASSWORD }}
MSSQL_PID: Developer
ports:
- 1433:1433

steps:
- uses: actions/checkout@v4

- name: Install SQL Server tools (sqlcmd)
run: |
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18>18.0.0
- name: Set up SQL db
working-directory: ${{ env.project_dir }}/data
env:
MSSQL_SA_PASSWORD: ${{env.DB_PASSWORD}}
AUTH_ARG: "N" # I can't get it to install sqlcmd>18. This is a hack
run: |
bash init-db.sh
Expand Down
30 changes: 13 additions & 17 deletions grai-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grai-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"remark-gfm": "^4.0.0",
"source-map-explorer": "^2.5.3",
"typescript": "^4.8.4",
"vite": "^4.5.3",
"vite": "^4.5.5",
"vite-plugin-environment": "^1.1.3",
"vite-tsconfig-paths": "^4.2.0",
"web-worker": "^1.2.0"
Expand Down
11 changes: 5 additions & 6 deletions grai-integrations/source-cube/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions grai-integrations/source-looker/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions grai-integrations/source-mssql/data/init-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ HOST="${DB_HOST:-localhost}"
PORT="${DB_PORT:-"1433"}"
MSSQL_SA_PASSWORD="${MSSQL_SA_PASSWORD:-"GraiGraiGr4i"}"
SERVER="tcp:$HOST,$PORT"
RETRY_LIMIT=${RETRY_LIMIT:-30}
RETRY_LIMIT=${RETRY_LIMIT:-60}
SQL_CMD_DIR=${SQL_CMD_DIR-"/opt/mssql-tools18/bin"}
export PATH=$PATH:$SQL_CMD_DIR

AUTH_ARG=${AUTH_ARG:-"Y"}
if [ "$AUTH_ARG" == "Y" ]; then
AUTH_ARG="-No"
else
AUTH_ARG=""
fi

SQL_CMD="sqlcmd -S $SERVER -U sa -P $MSSQL_SA_PASSWORD $AUTH_ARG"

/opt/mssql-tools/bin/sqlcmd -S $SERVER -U sa -P $MSSQL_SA_PASSWORD -Q 'SELECT 1' -b -o /dev/null
$SQL_CMD -Q 'SELECT 1' -b -o /dev/null
DBSTATUS=$?

if [[ $DBSTATUS -ne 0 ]]; then
echo "Waiting for database to become ready"
sleep 1
Expand All @@ -20,7 +29,8 @@ i=1
while [[ $DBSTATUS -ne 0 ]] && [[ $i -lt $RETRY_LIMIT ]]; do
i=$((i + 1))

/opt/mssql-tools/bin/sqlcmd -S $SERVER -U sa -P $MSSQL_SA_PASSWORD -Q 'SELECT 1' -b -o /dev/null
${SQL_CMD} -Q 'SELECT 1' -b
# -o /dev/null
DBSTATUS=$?

if [[ $DBSTATUS -ne 0 ]]; then
Expand All @@ -39,5 +49,5 @@ echo "Database ready"
for file in $(find $SCRIPT_DIR -type f -name '*.sql' | sort)
do
echo "Executing init script $file"
/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -l 30 -e -i $file
${SQL_CMD} -l 30 -e -i $file
done
5 changes: 2 additions & 3 deletions grai-integrations/source-mssql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand All @@ -8,11 +6,12 @@ services:
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: GraiGraiGr4i
MSSQL_PID: Developer
ports:
- 1433:1433
command: ['/bin/bash', '-c', '/init/init-db.sh & /opt/mssql/bin/sqlservr']
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $$MSSQL_SA_PASSWORD -Q 'select 1' -b -o /dev/null
test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $$MSSQL_SA_PASSWORD -Q 'select 1' -o /dev/null -b -No
interval: 3s
timeout: 3s
retries: 10
Loading

0 comments on commit b072da0

Please sign in to comment.