manual, parsing devs flist
This commit is contained in:
parent
ca99c4cda4
commit
38f65801ad
@ -223,27 +223,27 @@ You now have access to the Docker Hub from your local computer. We will then pro
|
|||||||
* Make sure the Docker Daemon is running
|
* Make sure the Docker Daemon is running
|
||||||
* Build the docker container
|
* Build the docker container
|
||||||
* Template:
|
* Template:
|
||||||
* ```
|
```
|
||||||
docker build -t <docker_username>/<docker_repo_name> .
|
docker build -t <docker_username>/<docker_repo_name> .
|
||||||
```
|
```
|
||||||
* Example:
|
* Example:
|
||||||
* ```
|
```
|
||||||
docker build -t username/debian12 .
|
docker build -t username/debian12 .
|
||||||
```
|
```
|
||||||
* Push the docker container to the [Docker Hub](https://hub.docker.com/)
|
* Push the docker container to the [Docker Hub](https://hub.docker.com/)
|
||||||
* Template:
|
* Template:
|
||||||
* ```
|
```
|
||||||
docker push <your_username>/<docker_repo_name>
|
docker push <your_username>/<docker_repo_name>
|
||||||
```
|
```
|
||||||
* Example:
|
* Example:
|
||||||
* ```
|
```
|
||||||
docker push username/debian12
|
docker push username/debian12
|
||||||
```
|
```
|
||||||
* You should now see your docker image on the [Docker Hub](https://hub.docker.com/) when you go into the menu option `My Profile`.
|
* You should now see your docker image on the [Docker Hub](https://hub.docker.com/) when you go into the menu option `My Profile`.
|
||||||
* Note that you can access this link quickly with the following template:
|
* Note that you can access this link quickly with the following template:
|
||||||
* ```
|
```
|
||||||
https://hub.docker.com/u/<account_name>
|
https://hub.docker.com/u/<account_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -265,13 +265,13 @@ We will now convert the Docker image into a Zero-OS flist. This part is so easy
|
|||||||
* Under `Name`, you will see all your available flists.
|
* Under `Name`, you will see all your available flists.
|
||||||
* Right-click on the flist you want and select `Copy Clean Link`. This URL will be used when deploying on the ThreeFold Playground. We show below the template and an example of what the flist URL looks like.
|
* Right-click on the flist you want and select `Copy Clean Link`. This URL will be used when deploying on the ThreeFold Playground. We show below the template and an example of what the flist URL looks like.
|
||||||
* Template:
|
* Template:
|
||||||
* ```
|
```
|
||||||
https://hub.grid.tf/<3BOT_name.3bot>/<docker_username>-<docker_image_name>-<tagname>.flist
|
https://hub.grid.tf/<3BOT_name.3bot>/<docker_username>-<docker_image_name>-<tagname>.flist
|
||||||
```
|
```
|
||||||
* Example:
|
* Example:
|
||||||
* ```
|
```
|
||||||
https://hub.grid.tf/idrnd.3bot/username-debian12-latest.flist
|
https://hub.grid.tf/idrnd.3bot/username-debian12-latest.flist
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -283,16 +283,14 @@ We will now convert the Docker image into a Zero-OS flist. This part is so easy
|
|||||||
* Choose your parameters (name, VM specs, etc.).
|
* Choose your parameters (name, VM specs, etc.).
|
||||||
* Under `flist`, paste the Debian flist from the TF Hub you copied previously.
|
* Under `flist`, paste the Debian flist from the TF Hub you copied previously.
|
||||||
* Make sure the entrypoint is as follows:
|
* Make sure the entrypoint is as follows:
|
||||||
* ```
|
```
|
||||||
/sbin/zinit init
|
/sbin/zinit init
|
||||||
```
|
```
|
||||||
* Choose a 3Node to deploy on
|
* Choose a 3Node to deploy on
|
||||||
* Click `Deploy`
|
* Click `Deploy`
|
||||||
|
|
||||||
That's it! You can now SSH into your Debian deployment and change the world one line of code at a time!
|
That's it! You can now SSH into your Debian deployment and change the world one line of code at a time!
|
||||||
|
|
||||||
*
|
|
||||||
|
|
||||||
## Conclusion
|
## Conclusion
|
||||||
|
|
||||||
In this case study, we've seen the overall process of creating a new flist to deploy a Debian workload on a Micro VM on the ThreeFold Playground.
|
In this case study, we've seen the overall process of creating a new flist to deploy a Debian workload on a Micro VM on the ThreeFold Playground.
|
||||||
|
@ -118,25 +118,25 @@ See example below.
|
|||||||
|
|
||||||
The main template to request information from the API is the following:
|
The main template to request information from the API is the following:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
curl -H "Authorization: bearer <API_token>" https://hub.grid.tf/api/flist/me/<flist_name> -X <COMMAND>
|
curl -H "Authorization: bearer <API_token>" https://hub.grid.tf/api/flist/me/<flist_name> -X <COMMAND>
|
||||||
```
|
```
|
||||||
|
|
||||||
For example, if we take the command `DELETE` of the previous section and we want to delete the flist `example-latest.flist` with the API Token `abc12`, we would write the following line:
|
For example, if we take the command `DELETE` of the previous section and we want to delete the flist `example-latest.flist` with the API Token `abc12`, we would write the following line:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
curl -H "Authorization: bearer abc12" https://hub.grid.tf/api/flist/me/example-latest.flist -X DELETE
|
curl -H "Authorization: bearer abc12" https://hub.grid.tf/api/flist/me/example-latest.flist -X DELETE
|
||||||
```
|
```
|
||||||
|
|
||||||
As another template example, if we wanted to rename the flist `current-name-latest.flist` to `new-name-latest.flist`, we would use the following template:
|
As another template example, if we wanted to rename the flist `current-name-latest.flist` to `new-name-latest.flist`, we would use the following template:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
curl -H "Authorization: bearer <API_token>" https://hub.grid.tf/api/flist/me/<current_flist_name>/rename/<new_flist_name> -X GET
|
curl -H "Authorization: bearer <API_token>" https://hub.grid.tf/api/flist/me/<current_flist_name>/rename/<new_flist_name> -X GET
|
||||||
```
|
```
|
||||||
|
|
||||||
To upload an flist to the ZOS Hub, you would use the following template:
|
To upload an flist to the ZOS Hub, you would use the following template:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
curl -H "Authorization: bearer <API_Token>" -X POST -F file=@my-local-archive.tar.gz \
|
curl -H "Authorization: bearer <API_Token>" -X POST -F file=@my-local-archive.tar.gz \
|
||||||
https://hub.grid.tf/api/flist/me/upload
|
https://hub.grid.tf/api/flist/me/upload
|
||||||
```
|
```
|
@ -60,33 +60,33 @@ To start the services for development or testing make sure first you have all th
|
|||||||
|
|
||||||
- Clone this repo
|
- Clone this repo
|
||||||
|
|
||||||
```bash
|
```
|
||||||
git clone https://github.com/threefoldtech/tfgrid-sdk-go.git
|
git clone https://github.com/threefoldtech/tfgrid-sdk-go.git
|
||||||
cd tfgrid-sdk-go/grid-proxy
|
cd tfgrid-sdk-go/grid-proxy
|
||||||
```
|
```
|
||||||
|
|
||||||
- The `Makefile` has all that you need to deal with Db, Explorer, Tests, and Docs.
|
- The `Makefile` has all that you need to deal with Db, Explorer, Tests, and Docs.
|
||||||
|
|
||||||
```bash
|
```
|
||||||
make help # list all the available subcommands.
|
make help # list all the available subcommands.
|
||||||
```
|
```
|
||||||
|
|
||||||
- For a quick test explorer server.
|
- For a quick test explorer server.
|
||||||
|
|
||||||
```bash
|
```
|
||||||
make all-start e=<MNEMONICS>
|
make all-start e=<MNEMONICS>
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can access the server at `http://localhost:8080`
|
Now you can access the server at `http://localhost:8080`
|
||||||
- Run the tests
|
- Run the tests
|
||||||
|
|
||||||
```bash
|
```
|
||||||
make test-all
|
make test-all
|
||||||
```
|
```
|
||||||
|
|
||||||
- Generate docs.
|
- Generate docs.
|
||||||
|
|
||||||
```bash
|
```
|
||||||
make docs
|
make docs
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ For more illustrations about the commands needed to work on the project, see the
|
|||||||
|
|
||||||
- You can either build the project:
|
- You can either build the project:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
make build
|
make build
|
||||||
chmod +x cmd/proxy_server/server \
|
chmod +x cmd/proxy_server/server \
|
||||||
&& mv cmd/proxy_server/server /usr/local/bin/gridproxy-server
|
&& mv cmd/proxy_server/server /usr/local/bin/gridproxy-server
|
||||||
@ -117,7 +117,7 @@ For more illustrations about the commands needed to work on the project, see the
|
|||||||
- Or download a release:
|
- Or download a release:
|
||||||
Check the [releases](https://github.com/threefoldtech/tfgrid-sdk-go/releases) page and edit the next command with the chosen version.
|
Check the [releases](https://github.com/threefoldtech/tfgrid-sdk-go/releases) page and edit the next command with the chosen version.
|
||||||
|
|
||||||
```bash
|
```
|
||||||
wget https://github.com/threefoldtech/tfgrid-sdk-go/releases/download/v1.6.7-rc2/tfgridclient_proxy_1.6.7-rc2_linux_amd64.tar.gz \
|
wget https://github.com/threefoldtech/tfgrid-sdk-go/releases/download/v1.6.7-rc2/tfgridclient_proxy_1.6.7-rc2_linux_amd64.tar.gz \
|
||||||
&& tar -xzf tfgridclient_proxy_1.6.7-rc2_linux_amd64.tar.gz \
|
&& tar -xzf tfgridclient_proxy_1.6.7-rc2_linux_amd64.tar.gz \
|
||||||
&& chmod +x server \
|
&& chmod +x server \
|
||||||
@ -128,7 +128,7 @@ For more illustrations about the commands needed to work on the project, see the
|
|||||||
|
|
||||||
- Create the service file
|
- Create the service file
|
||||||
|
|
||||||
```bash
|
```
|
||||||
cat << EOF > /etc/systemd/system/gridproxy-server.service
|
cat << EOF > /etc/systemd/system/gridproxy-server.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=grid proxy server
|
Description=grid proxy server
|
||||||
|
Loading…
Reference in New Issue
Block a user