Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- Dockerfile +6 -9
- README.md +6 -36
- requirements.txt +2 -0
Dockerfile
CHANGED
|
@@ -6,15 +6,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 6 |
build-essential curl git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
COPY requirements.txt
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
COPY start.sh /app/start.sh
|
| 14 |
-
RUN chmod +x /app/start.sh
|
| 15 |
|
| 16 |
-
EXPOSE
|
| 17 |
-
|
| 18 |
-
STREAMLIT_BROWSER_GATHERUSAGESTATS=false
|
| 19 |
|
| 20 |
-
ENTRYPOINT ["/
|
|
|
|
| 6 |
build-essential curl git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
COPY requirements.txt ./
|
| 10 |
+
COPY src/ ./src/
|
| 11 |
|
| 12 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
EXPOSE 8501
|
| 15 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
|
|
|
| 16 |
|
| 17 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: π
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
|
@@ -11,39 +11,9 @@ pinned: false
|
|
| 11 |
short_description: Streamlit template space
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
forums](https://discuss.streamlit.io).
|
| 20 |
-
|
| 21 |
-
# OCI GenAI Agent β Streamlit (HF Docker, `src/` layout)
|
| 22 |
-
|
| 23 |
-
This package matches the provided Dockerfile layout (uses `src/streamlit_app.py`).
|
| 24 |
-
|
| 25 |
-
## Deploy to Hugging Face Spaces (Docker)
|
| 26 |
-
|
| 27 |
-
1. Create a new Space β **Docker**.
|
| 28 |
-
2. Upload these files to the root, keeping the `src/` folder intact.
|
| 29 |
-
3. In **Settings β Secrets**, add:
|
| 30 |
-
- `OCI_TENANCY_OCID`
|
| 31 |
-
- `OCI_USER_OCID`
|
| 32 |
-
- `OCI_FINGERPRINT`
|
| 33 |
-
- `OCI_REGION` (e.g., `us-ashburn-1`)
|
| 34 |
-
- `OCI_GENAI_AGENT_ENDPOINT_OCID` (your Agent Endpoint OCID)
|
| 35 |
-
- One of:
|
| 36 |
-
- `OCI_KEY_BASE64` (preferred) β base64 of your `oci_api_key.pem`
|
| 37 |
-
- `OCI_KEY_PEM` β raw PEM content (less safe)
|
| 38 |
-
- Optional:
|
| 39 |
-
- `OCI_GENAI_AGENT_RUNTIME_ENDPOINT` β override runtime endpoint
|
| 40 |
-
- `OCI_KEY_PASSPHRASE` β if your PEM is encrypted
|
| 41 |
-
|
| 42 |
-
## Local build/run
|
| 43 |
-
|
| 44 |
-
```bash
|
| 45 |
-
docker build -t oci-agent-hf .
|
| 46 |
-
docker run --rm -p 8501:8501 -e OCI_TENANCY_OCID=ocid1.tenancy.oc1... -e OCI_USER_OCID=ocid1.user.oc1... -e OCI_FINGERPRINT="aa:bb:cc:..." -e OCI_REGION="us-ashburn-1" -e OCI_GENAI_AGENT_ENDPOINT_OCID=ocid1.genaiagentendpoint.oc1.iad... -e OCI_KEY_BASE64="$(base64 -w 0 ~/.oci/oci_api_key.pem)" oci-agent-hf
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
Open http://localhost:8501
|
|
|
|
| 1 |
---
|
| 2 |
+
title: StreamlitBase
|
| 3 |
emoji: π
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
|
|
|
| 11 |
short_description: Streamlit template space
|
| 12 |
---
|
| 13 |
|
| 14 |
+
This matches the **HF Docker template (app_port=8501)** and adds OCI support.
|
| 15 |
+
If your Splash page worked, this layout will, too.
|
| 16 |
|
| 17 |
+
1) Deploy these files.
|
| 18 |
+
2) The app will render a Connectivity Test first (no OCI).
|
| 19 |
+
3) Turn that off and set your Agent Endpoint OCID to chat via OCI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
|
|
|
|
|
| 1 |
streamlit==1.36.0
|
| 2 |
oci==2.157.1
|
|
|
|
| 1 |
+
altair
|
| 2 |
+
pandas
|
| 3 |
streamlit==1.36.0
|
| 4 |
oci==2.157.1
|