-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hyperledger-labs:dev' into dev
- Loading branch information
Showing
7 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM node:20-alpine AS frontend-build | ||
WORKDIR /app/frontend | ||
COPY frontend . | ||
RUN yarn install | ||
|
||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS backend-build | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV PATH="/usr/local/bin:${PATH}" | ||
RUN apt-get update && \ | ||
apt-get install -y python3-pip python3-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app/core | ||
COPY core/requirements.txt . | ||
RUN pip3 install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118 | ||
|
||
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV PATH="/usr/local/bin:${PATH}" | ||
ENV NODE_VERSION=20.x | ||
RUN apt-get update && apt-get install -y \ | ||
python3-pip \ | ||
wget \ | ||
curl \ | ||
&& curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - \ | ||
&& apt-get install -y nodejs \ | ||
&& npm install -g yarn \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
COPY --from=backend-build /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages | ||
COPY core ./core | ||
COPY --from=frontend-build /app/frontend ./frontend | ||
COPY frontend/package.json frontend/yarn.lock ./frontend/ | ||
WORKDIR /app/frontend | ||
RUN yarn install --production | ||
WORKDIR /app | ||
COPY entrypoint.sh . | ||
RUN chmod +x entrypoint.sh | ||
EXPOSE 3000 8080 | ||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
```bash | ||
docker build -t aifaq . | ||
``` | ||
Now run this image from this command | ||
```bash | ||
docker run --gpus all -p 3000:3000 -p 8080:8080 aifaq | ||
``` | ||
|
||
### To check the frontend running on the lightining ai studio. | ||
1. Click on this add icon. | ||
|
||
![alt text](image-3.png) | ||
|
||
2. Install the web port from here . | ||
|
||
![alt text](image.png) | ||
|
||
3. Now click on this icon. | ||
|
||
![alt text](image-1.png) | ||
|
||
4. Now update the port 3000 in here. | ||
|
||
![alt text](image-2.png) | ||
|
||
### The Backend can be checked using this curl request on the new terminal by this curl request. | ||
|
||
```console | ||
curl --header "Content-Type: application/json" --request POST --data '{"text": "How to install Hyperledger fabric?"}' http://127.0.0.1:8080/query | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
cd /app/core | ||
python3 fetch_and_organize_data.py | ||
python3 api.py & | ||
|
||
cd /app/frontend | ||
yarn dev |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.