Skip to content

Commit 99e39b2

Browse files
Merge pull request #48 from atlas-bi/2022.01.1-patch-1
2022.01.1 patch 1
2 parents 9e6cb1d + 714bf37 commit 99e39b2

File tree

3 files changed

+74
-36
lines changed

3 files changed

+74
-36
lines changed

.github/workflows/demo.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,31 @@ on:
66

77
workflow_dispatch:
88

9+
push:
10+
branches:
11+
- master
912
jobs:
1013
heroku-deploy:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: Check out repository
1417
uses: actions/checkout@v2
15-
- name: Deploy to Heroku
18+
19+
- name: Deploy demo search
20+
uses: gonuit/[email protected]
21+
with:
22+
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
23+
heroku_app_name: ${{ secrets.HEROKU_APP_NAME_SEARCH }}
24+
email: ${{ secrets.HEROKU_EMAIL }}
25+
dockerfile_name: solr.Dockerfile
26+
docker_options: --no-cache --build-arg HOST=${{ secrets.SQL_HOST }} --build-arg PASSWORD=${{ secrets.SQL_PASS }} --build-arg USER=${{ secrets.SQL_USER }}
27+
28+
- name: Deploy demo app
1629
uses: gonuit/[email protected]
1730
with:
1831
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
1932
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
2033
email: ${{ secrets.HEROKU_EMAIL }}
2134
dockerfile_name: Dockerfile
22-
docker_options: --no-cache --build-arg HOST="${{SQL_HOST}}" --build-arg PASSWORD="${{SQL_PASS}}" --build-arg USER=${{SQL_USER}}
35+
docker_options: --no-cache --build-arg HOST=${{ secrets.SQL_HOST }} --build-arg PASSWORD=${{ secrets.SQL_PASS }} --build-arg USER=${{ secrets.SQL_USER }}
36+

Dockerfile

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,15 @@ COPY ["./web/.", "./web/"]
2020
WORKDIR "/app/web/"
2121
RUN dotnet publish -c Release -o out
2222

23-
FROM python:3.10-alpine as search
24-
WORKDIR /app
25-
ARG USER
26-
ARG PASSWORD
27-
ARG HOST
28-
# copy site
29-
COPY --from=build ["/app/web/out", "./"]
30-
31-
# startup search and load data
32-
RUN apk add --no-cache openjdk11 bash lsof python3-dev curl gcc git py3-pip gcc libc-dev g++ libffi-dev libxml2 unixodbc-dev && \
33-
pip3 install pyodbc pysolr pytz
34-
35-
# install sql server driver
36-
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.8.1.1-1_amd64.apk && \
37-
apk add --allow-untrusted msodbcsql17_17.8.1.1-1_amd64.apk
38-
39-
# pull solr etl
40-
RUN mkdir etl && cd etl && git clone --depth 1 https://github.com/atlas-bi/Solr-Search-ETL.git .
41-
42-
# create settings
43-
RUN cd etl && echo "SOLR_URL = \"http://localhost:8983/solr/atlas\"" > settings.py && \
44-
echo "SOLR_LOOKUP_URL = \"http://localhost:8983/solr/atlas_lookups\"" >> settings.py && \
45-
echo "SQL_CONN = \"SERVER=$HOST;DATABASE=atlas;UID=$USER;PWD=$PASSWORD\"" >> settings.py
46-
47-
# load search
48-
RUN solr/bin/solr start -force -noprompt -v && sleep 20 && cd etl && python3 atlas_collections.py && python3 atlas_groups.py && python3 atlas_initiatives.py && \
49-
python3 atlas_lookups.py && python3 atlas_reports.py && python3 atlas_terms.py && \
50-
python3 atlas_users.py
51-
5223
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
5324
WORKDIR /app
54-
RUN apk add --no-cache openjdk11 bash lsof
55-
COPY --from=search ["/app", "./"]
25+
COPY --from=build ["/app/web/out", "./"]
5626

5727
ARG USER
5828
ARG PASSWORD
5929
ARG HOST
6030

6131
# create config
62-
RUN echo "{\"solr\": {\"atlas_address\": \"http://localhost:8983/solr/atlas\"},\"ConnectionStrings\": {\"AtlasDatabase\": \"Server=$HOST;Database=atlas;User Id=$USER; Password=$PASSWORD; MultipleActiveResultSets=true\"}}" > appsettings.cust.json
63-
32+
RUN echo "{\"solr\": {\"atlas_address\": \"https://atlas-dotnet-search.herokuapp.com/solr/atlas\"},\"ConnectionStrings\": {\"AtlasDatabase\": \"Server=$HOST;Database=atlas;User Id=$USER; Password=$PASSWORD; MultipleActiveResultSets=true\"}}" > appsettings.cust.json
6433
# in release 2022.02.2 we need to change the name from atlas_dotnet to atlas_web
65-
CMD solr/bin/solr start -force -noprompt && ASPNETCORE_URLS=http://*:$PORT dotnet "Atlas_Dotnet.dll"
34+
CMD ASPNETCORE_URLS=http://*:$PORT dotnet "Atlas_Dotnet.dll"

solr.Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# to build
2+
# docker build --build-arg HOST=host PASSWORD=password USER=user --tag atlas_demo_search -f solr.Dockerfile .
3+
4+
# to run locally
5+
# docker run -i -t -p 8983:8983 -e PORT=8983 -u 0 atlas_demo_search:latest
6+
7+
# to get in shell
8+
# docker run --entrypoint sh -i -t -u 0 atlas_demo_search:latest
9+
10+
# to access webapp
11+
# http://localhost:8983
12+
13+
FROM python:3.10-alpine as search
14+
WORKDIR /app
15+
ARG USER
16+
ARG PASSWORD
17+
ARG HOST
18+
# copy site
19+
COPY ["./web/solr", "./"]
20+
21+
# startup search and load data
22+
RUN apk add --no-cache openjdk11 bash lsof python3-dev curl gcc git py3-pip gcc libc-dev g++ libffi-dev libxml2 unixodbc-dev && \
23+
pip3 install pyodbc pysolr pytz
24+
25+
# install sql server driver
26+
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.8.1.1-1_amd64.apk && \
27+
apk add --allow-untrusted msodbcsql17_17.8.1.1-1_amd64.apk
28+
29+
# pull solr etl
30+
RUN mkdir etl && cd etl && git clone --depth 1 https://github.com/atlas-bi/Solr-Search-ETL.git .
31+
32+
# create settings
33+
RUN cd etl && echo "SOLR_URL = \"http://localhost:8983/solr/atlas\"" > settings.py && \
34+
echo "SOLR_LOOKUP_URL = \"http://localhost:8983/solr/atlas_lookups\"" >> settings.py && \
35+
echo "SQL_CONN = \"SERVER=$HOST;DATABASE=atlas;UID=$USER;PWD=$PASSWORD\"" >> settings.py
36+
37+
# load search
38+
RUN chmod -R 777 bin && bin/solr start -force -noprompt -v && sleep 20 && cd etl && python3 atlas_collections.py && python3 atlas_groups.py && python3 atlas_initiatives.py && \
39+
python3 atlas_lookups.py && python3 atlas_reports.py && python3 atlas_terms.py && \
40+
python3 atlas_users.py
41+
42+
FROM alpine:latest
43+
WORKDIR /app
44+
RUN apk add --no-cache openjdk11 bash lsof
45+
COPY --from=search ["/app", "./"]
46+
47+
ARG USER
48+
ARG PASSWORD
49+
ARG HOST
50+
51+
# create config
52+
53+
RUN chmod -R 777 bin
54+
# in release 2022.02.2 we need to change the name from atlas_dotnet to atlas_web
55+
CMD bin/solr start -force -noprompt -f -p $PORT

0 commit comments

Comments
 (0)