janwinkler1 commited on
Commit
4249f7e
·
1 Parent(s): c316af1

readme additions initial commit

Browse files
Files changed (2) hide show
  1. docs/docker-setup.md +39 -0
  2. docs/huggingface-spaces.md +58 -0
docs/docker-setup.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DockerSetup
2
+
3
+ This is a short version of howto install Docker on Ubuntu 20.04. It is basically a summary of the following source:\
4
+ * https://docs.docker.com/install/linux/docker-ce/ubuntu/#os-requirements
5
+
6
+ ## Install Docker
7
+ ```bash
8
+ sudo apt update
9
+ sudo apt-get install \
10
+ apt-transport-https \
11
+ ca-certificates \
12
+ curl \
13
+ gnupg \
14
+ lsb-release
15
+
16
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg |\
17
+ sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
18
+ echo \
19
+ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
20
+ https://download.docker.com/linux/ubuntu \
21
+ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
22
+ sudo apt update
23
+ sudo apt install docker-ce
24
+ ```
25
+
26
+ ## Add user to "docker" group & re-login
27
+ Add yourself to the docker group (to get access to the docker deamon socket)\
28
+ note: beeing member of docker gives you root access via the docker deamon
29
+ ```bash
30
+ sudo usermod -a -G docker `whoami`
31
+ ```
32
+ Logout / Login to load the new group rights\
33
+ Using Ubuntu Gnome it may be required to restart
34
+
35
+ ## Install Docker-Compose
36
+ ```bash
37
+ sudo apt install python3-pip
38
+ sudo pip3 install docker-compose
39
+ ```
docs/huggingface-spaces.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Hugging Face Spaces and GitHub repositories serve different but complementary purposes. Here’s a comparison and how they can be used together:
2
+
3
+ ### Comparison with GitHub Repositories
4
+
5
+ - **GitHub Repository**:
6
+ - **Purpose**: Primarily used for version control, collaboration, and sharing of code and projects.
7
+ - **Capabilities**: Stores code, tracks changes, manages issues, and supports CI/CD pipelines.
8
+ - **Usage**: Developers collaborate on software development projects, manage codebases, and deploy applications.
9
+
10
+ - **Hugging Face Spaces**:
11
+ - **Purpose**: Designed specifically for deploying interactive machine learning applications and demos.
12
+ - **Capabilities**: Hosts and deploys machine learning models and applications using frameworks like Streamlit, Gradio, or custom HTML/CSS/JS.
13
+ - **Usage**: Users create and share interactive demos and applications, especially in the field of machine learning.
14
+
15
+ ### Integration with GitHub
16
+
17
+ You can import a GitHub repository into Hugging Face Spaces to deploy an application hosted on GitHub. Here’s how to do it:
18
+
19
+ 1. **Create a Space on Hugging Face**:
20
+ - Go to the Hugging Face Spaces website and create a new Space.
21
+
22
+ 2. **Link to GitHub Repository**:
23
+ - During the setup of the new Space, you can link it to a GitHub repository. This allows Hugging Face Spaces to pull the code from your GitHub repo.
24
+
25
+ 3. **Configure Your Space**:
26
+ - Ensure your repository contains the necessary files for the framework you are using (Streamlit, Gradio, or HTML/CSS/JS).
27
+ - For example, if you are using Streamlit, ensure you have a `requirements.txt` file for dependencies and a main Python script that runs the Streamlit app.
28
+
29
+ 4. **Deploy the Application**:
30
+ - Once linked, Hugging Face Spaces will automatically deploy the application from the GitHub repository.
31
+ - Any updates pushed to the GitHub repository can automatically trigger redeployment of the application on Hugging Face Spaces.
32
+
33
+ ### Example Steps to Import a GitHub Repo into Hugging Face Spaces
34
+
35
+ 1. **Create a New Space**:
36
+ - Navigate to Hugging Face Spaces and click on “New Space”.
37
+
38
+ 2. **Set Up Space**:
39
+ - Choose a name for your Space, select the appropriate SDK (e.g., Streamlit, Gradio, or HTML), and choose the visibility (public or private).
40
+
41
+ 3. **Connect GitHub Repository**:
42
+ - In the Space settings, you will find an option to link a GitHub repository. Provide the URL of your GitHub repository.
43
+ - Hugging Face Spaces will clone your GitHub repository to use it as the source code for your Space.
44
+
45
+ 4. **Configure and Deploy**:
46
+ - Make sure your GitHub repository is set up correctly for the chosen framework. For example, a Streamlit app should have a `requirements.txt` and an entry-point script like `app.py`.
47
+ - Once everything is set up, your Space will be deployed and can be accessed via a URL provided by Hugging Face.
48
+
49
+ 5. **Update and Maintain**:
50
+ - Any changes you push to the linked GitHub repository will be reflected in the deployed application after the repository is synced with Hugging Face Spaces.
51
+
52
+ ### Benefits
53
+
54
+ - **Version Control**: Leveraging GitHub’s version control capabilities ensures that your code is managed effectively.
55
+ - **Collaboration**: Teams can collaborate on the development of the application using GitHub’s collaborative tools.
56
+ - **Easy Deployment**: Hugging Face Spaces simplifies the deployment of interactive machine learning applications without the need for complex infrastructure management.
57
+
58
+ By combining the strengths of GitHub and Hugging Face Spaces, you can efficiently develop, manage, and deploy machine learning applications.