Wauplin HF staff commited on
Commit
5ceffc0
1 Parent(s): 2d79d89

Enable Space CI

Browse files

This PR enables Space CI on your Space. **Gradio Space CI is a tool to create ephemeral Spaces for each PR opened on your Space repo.** The goal is to improve developer experience by making the review process as lean as possible.

### ⚙️ How it works:

- Listens to pull requests events:
- If PR is opened => starts an ephemeral Space
- If PR is updated => updates the Space
- If PR is closed => deleted the Space
- Checks PR author:
- If trusted author => ephemeral Space is configured with variables, secrets and hardware.
- If not a trusted author => ephemeral Space is started without configuration
- Space owners are trusted by default. Additional "trusted authors" can be configuration manually.

### ⚠️ Before merging:

1. Check that the configuration is correct. By default the Space is configured to run ephemeral Spaces on a (free) CPU instance without any secrets.
2. You must set `HF_TOKEN` as a secret in your Space settings. Token must have 'write' permission. You can create a new one in your [User settings](https://huggingface.co/settings/token).

---
This is an automated PR created with https://huggingface.co/spaces/Wauplin/gradio-space-ci.

For more details about Space CI, checkout [this page]](https://huggingface.co/spaces/Wauplin/gradio-space-ci/blob/main/README.md).

If you find any issues, please report here: https://huggingface.co/spaces/Wauplin/gradio-space-ci/discussions

Feel free to ignore this PR.

Files changed (3) hide show
  1. README.md +7 -3
  2. app.py +6 -0
  3. requirements.txt +2 -1
README.md CHANGED
@@ -1,13 +1,17 @@
1
  ---
2
  title: Gradio User History
3
- emoji: 🖼️
4
- colorFrom: gray
5
- colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 3.44.4
8
  app_file: app.py
 
 
 
9
  pinned: false
10
  hf_oauth: true
 
 
 
 
11
  ---
12
 
13
  # Bring User History to your Spaces 🚀
 
1
  ---
2
  title: Gradio User History
 
 
 
3
  sdk: gradio
4
  sdk_version: 3.44.4
5
  app_file: app.py
6
+ emoji: 🖼️
7
+ colorFrom: gray
8
+ colorTo: indigo
9
  pinned: false
10
  hf_oauth: true
11
+ space_ci:
12
+ trusted_authors: []
13
+ secrets: []
14
+ hardware: cpu-basic
15
  ---
16
 
17
  # Bring User History to your Spaces 🚀
app.py CHANGED
@@ -8,6 +8,12 @@ import gradio as gr
8
  import gradio_user_history as gr_user_history
9
  from gradio_client import Client
10
 
 
 
 
 
 
 
11
 
12
  client = Client("runwayml/stable-diffusion-v1-5")
13
 
 
8
  import gradio_user_history as gr_user_history
9
  from gradio_client import Client
10
 
11
+ from gradio_space_ci import enable_space_ci
12
+
13
+ enable_space_ci()
14
+
15
+
16
+
17
 
18
  client = Client("runwayml/stable-diffusion-v1-5")
19
 
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- git+https://huggingface.co/spaces/Wauplin/gradio-user-history
 
 
1
+ git+https://huggingface.co/spaces/Wauplin/gradio-user-history
2
+ gradio-space-ci @ git+https://huggingface.co/spaces/Wauplin/[email protected]