add basic lektor project
This commit is contained in:
parent
b38c49022a
commit
0e9bdc0a6f
12 changed files with 171 additions and 21 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ucloud-docs-build/
|
17
Makefile
Normal file
17
Makefile
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
BUILDDIR=ucloud-docs-build
|
||||||
|
DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/ucloud/
|
||||||
|
|
||||||
|
all: publish
|
||||||
|
|
||||||
|
pull:
|
||||||
|
git pull
|
||||||
|
|
||||||
|
publish: pull build permissions
|
||||||
|
rsync -av --exclude .lektor/ $(BUILDDIR)/ $(DESTINATION)
|
||||||
|
|
||||||
|
permissions: build
|
||||||
|
find $(BUILDDIR) -type f -exec chmod 0644 {} \;
|
||||||
|
find $(BUILDDIR) -type d -exec chmod 0755 {} \;
|
||||||
|
|
||||||
|
build:
|
||||||
|
cd lektor && lektor build -O ../$(BUILDDIR)
|
48
README.md
48
README.md
|
@ -1,3 +1,9 @@
|
||||||
|
## ucloud docs
|
||||||
|
|
||||||
|
Are stored in lektor/ and use
|
||||||
|
[lektor](https://www.getlektor.com/).
|
||||||
|
|
||||||
|
|
||||||
## ucloud flows
|
## ucloud flows
|
||||||
|
|
||||||
Stuff that we want to do with ucloud
|
Stuff that we want to do with ucloud
|
||||||
|
@ -26,7 +32,7 @@ digraph{
|
||||||
ucloudsomething->cephcluster [ label=" Link/copy image "]
|
ucloudsomething->cephcluster [ label=" Link/copy image "]
|
||||||
cephcluster -> { ceph1, ceph2, ceph3}
|
cephcluster -> { ceph1, ceph2, ceph3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -37,7 +43,7 @@ digraph{
|
||||||
digraph {
|
digraph {
|
||||||
subgraph g1 {
|
subgraph g1 {
|
||||||
node [ shape="box"]
|
node [ shape="box"]
|
||||||
|
|
||||||
user [ label="User" shape="circle"]
|
user [ label="User" shape="circle"]
|
||||||
user -> cli [ label=" uses "]
|
user -> cli [ label=" uses "]
|
||||||
|
|
||||||
|
@ -49,14 +55,14 @@ digraph {
|
||||||
api -> uotp [label="Verify token [2]" dir="both"]
|
api -> uotp [label="Verify token [2]" dir="both"]
|
||||||
api -> etcd [label="Create (VM Entry and \nA Request to Schedule VM) [3]"];
|
api -> etcd [label="Create (VM Entry and \nA Request to Schedule VM) [3]"];
|
||||||
}
|
}
|
||||||
|
|
||||||
subgraph cluster_otp {
|
subgraph cluster_otp {
|
||||||
uotp [shape="diamond" label="ungleich otp"]
|
uotp [shape="diamond" label="ungleich otp"]
|
||||||
}
|
}
|
||||||
subgraph cluster_etcd {
|
subgraph cluster_etcd {
|
||||||
etcd
|
etcd
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -80,7 +86,7 @@ digraph {
|
||||||
```graphviz
|
```graphviz
|
||||||
digraph {
|
digraph {
|
||||||
node [ shape="box"];
|
node [ shape="box"];
|
||||||
|
|
||||||
subgraph cluster_etcd {
|
subgraph cluster_etcd {
|
||||||
etcd
|
etcd
|
||||||
}
|
}
|
||||||
|
@ -90,13 +96,13 @@ digraph {
|
||||||
host -> start_vm [label="[9]"]
|
host -> start_vm [label="[9]"]
|
||||||
start_vm
|
start_vm
|
||||||
}
|
}
|
||||||
|
|
||||||
start_vm -> etcd [label=" Set VM Status to Running"]
|
start_vm -> etcd [label=" Set VM Status to Running"]
|
||||||
start_vm -> ceph_cluster [label=" If VM isn't created already then Copy VM's base image\n to uservms pool and rename it to match VM's uuid [9a]"]
|
start_vm -> ceph_cluster [label=" If VM isn't created already then Copy VM's base image\n to uservms pool and rename it to match VM's uuid [9a]"]
|
||||||
ceph_cluster -> start_vm [label="VM Created [9b]"]
|
ceph_cluster -> start_vm [label="VM Created [9b]"]
|
||||||
start_vm -> ceph_cluster [label="Start VM [10]"]
|
start_vm -> ceph_cluster [label="Start VM [10]"]
|
||||||
|
|
||||||
|
|
||||||
subgraph cluster_ceph {
|
subgraph cluster_ceph {
|
||||||
ceph_cluster [label="CEPH Cluster"]
|
ceph_cluster [label="CEPH Cluster"]
|
||||||
}
|
}
|
||||||
|
@ -142,7 +148,7 @@ digraph {
|
||||||
label="Create VM with ucloud"
|
label="Create VM with ucloud"
|
||||||
|
|
||||||
cli->api->etcd->ucloudnetwork;
|
cli->api->etcd->ucloudnetwork;
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -150,14 +156,14 @@ digraph {
|
||||||
|
|
||||||
* Network is usable for user directly
|
* Network is usable for user directly
|
||||||
* When VM is started, network might be created on host
|
* When VM is started, network might be created on host
|
||||||
* Status: 90% done,
|
* Status: 90% done,
|
||||||
|
|
||||||
|
|
||||||
```graphviz
|
```graphviz
|
||||||
digraph {
|
digraph {
|
||||||
|
|
||||||
label="Create VM with ucloud"
|
label="Create VM with ucloud"
|
||||||
|
|
||||||
cli;
|
cli;
|
||||||
createnetwork [ label="Create VXLAN on device, create bridge"]
|
createnetwork [ label="Create VXLAN on device, create bridge"]
|
||||||
createonhost [ label="Create VM on host"]
|
createonhost [ label="Create VM on host"]
|
||||||
|
@ -168,27 +174,27 @@ digraph {
|
||||||
ucloudhost->ucloudhost [ label="Wait until network exists"]
|
ucloudhost->ucloudhost [ label="Wait until network exists"]
|
||||||
ucloudnetwork->etcd [ label="Check for new networks"]
|
ucloudnetwork->etcd [ label="Check for new networks"]
|
||||||
ucloudhost->createonhost [ label="Create VM in network(s)"]
|
ucloudhost->createonhost [ label="Create VM in network(s)"]
|
||||||
|
|
||||||
ucloudnetwork->network [ label="Check whether network exists locally"]
|
ucloudnetwork->network [ label="Check whether network exists locally"]
|
||||||
network->createnetwork [ label="no"];
|
network->createnetwork [ label="no"];
|
||||||
network->noop [ label="yes"]
|
network->noop [ label="yes"]
|
||||||
|
|
||||||
subgraph cluster_anywhere {
|
subgraph cluster_anywhere {
|
||||||
api
|
api
|
||||||
etcd
|
etcd
|
||||||
}
|
}
|
||||||
|
|
||||||
subgraph cluster_host {
|
subgraph cluster_host {
|
||||||
ucloudhost;
|
ucloudhost;
|
||||||
ucloudnetwork;
|
ucloudnetwork;
|
||||||
host;
|
host;
|
||||||
network;
|
network;
|
||||||
createnetwork;
|
createnetwork;
|
||||||
createonhost;
|
createonhost;
|
||||||
noop;
|
noop;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -201,12 +207,12 @@ Extending the flow from the case for managing networks
|
||||||
digraph {
|
digraph {
|
||||||
|
|
||||||
label="Create VM with ucloud"
|
label="Create VM with ucloud"
|
||||||
|
|
||||||
newvxlan [ label="Assign new VXLAN ID"]
|
newvxlan [ label="Assign new VXLAN ID"]
|
||||||
newnet [ label="Assign new /64 IPv6 network"]
|
newnet [ label="Assign new /64 IPv6 network"]
|
||||||
needsnet [ label="Needs IPAM?"]
|
needsnet [ label="Needs IPAM?"]
|
||||||
radvd [ label="Create RA instance (radvd)"]
|
radvd [ label="Create RA instance (radvd)"]
|
||||||
|
|
||||||
etcd->ucloudnetworkmanager [ label="New network requests"]
|
etcd->ucloudnetworkmanager [ label="New network requests"]
|
||||||
ucloudnetworkmanager->newvxlan;
|
ucloudnetworkmanager->newvxlan;
|
||||||
newvxlan->needsnet;
|
newvxlan->needsnet;
|
||||||
|
@ -222,7 +228,7 @@ digraph {
|
||||||
label="Router";
|
label="Router";
|
||||||
radvd;
|
radvd;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -259,7 +265,7 @@ We can use this case as a base for development. We might add VM migration (w/ co
|
||||||
|
|
||||||
## From zero to fully functional ucloud cluster (ceph, production)
|
## From zero to fully functional ucloud cluster (ceph, production)
|
||||||
```bash=
|
```bash=
|
||||||
# We assume that the ceph configuration files are already in place
|
# We assume that the ceph configuration files are already in place
|
||||||
# i.e under /etc/ceph/
|
# i.e under /etc/ceph/
|
||||||
|
|
||||||
// Only needed on alpine linux
|
// Only needed on alpine linux
|
||||||
|
|
42
lektor/assets/static/style.css
Normal file
42
lektor/assets/static/style.css
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
body {
|
||||||
|
font-family: 'Verdana', sans-serif;
|
||||||
|
margin: 50px 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #2a99b6;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #33bbdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
header, footer, div.page {
|
||||||
|
width: 760px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: #daeef3;
|
||||||
|
padding: 20px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h1 {
|
||||||
|
color: #169bbd;
|
||||||
|
margin: 0;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav ul li {
|
||||||
|
display: inline;
|
||||||
|
margin: 0 8px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.page {
|
||||||
|
background: #f1fbfe;
|
||||||
|
}
|
7
lektor/content/about/contents.lr
Normal file
7
lektor/content/about/contents.lr
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
title: About this Website
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a website that was made with the Lektor quickstart.
|
||||||
|
|
||||||
|
And it does not contain a lot of information.
|
6
lektor/content/contents.lr
Normal file
6
lektor/content/contents.lr
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
title: Welcome to ucloud!
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a basic demo website that shows how to use Lektor for a basic
|
||||||
|
website with some pages.
|
9
lektor/content/projects/contents.lr
Normal file
9
lektor/content/projects/contents.lr
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
title: Projects
|
||||||
|
---
|
||||||
|
body:
|
||||||
|
|
||||||
|
This is a list of the projects:
|
||||||
|
|
||||||
|
* Project 1
|
||||||
|
* Project 2
|
||||||
|
* Project 3
|
11
lektor/models/page.ini
Normal file
11
lektor/models/page.ini
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[model]
|
||||||
|
name = Page
|
||||||
|
label = {{ this.title }}
|
||||||
|
|
||||||
|
[fields.title]
|
||||||
|
label = Title
|
||||||
|
type = string
|
||||||
|
|
||||||
|
[fields.body]
|
||||||
|
label = Body
|
||||||
|
type = markdown
|
28
lektor/templates/layout.html
Normal file
28
lektor/templates/layout.html
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="{{ '/static/style.css'|url }}">
|
||||||
|
<title>{% block title %}Welcome{% endblock %} — ucloud</title>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>ucloud</h1>
|
||||||
|
<nav>
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li{% if this._path == '/' %} class="active"{% endif
|
||||||
|
%}><a href="{{ '/'|url }}">Welcome</a></li>
|
||||||
|
{% for href, title in [
|
||||||
|
['/projects', 'Projects'],
|
||||||
|
['/about', 'About']
|
||||||
|
] %}
|
||||||
|
<li{% if this.is_child_of(href) %} class="active"{% endif
|
||||||
|
%}><a href="{{ href|url }}">{{ title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<div class="page">
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
© Copyright 2019 by ungleich.
|
||||||
|
</footer>
|
||||||
|
</body>
|
15
lektor/templates/macros/pagination.html
Normal file
15
lektor/templates/macros/pagination.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% macro render_pagination(pagination) %}
|
||||||
|
<div class="pagination">
|
||||||
|
{% if pagination.has_prev %}
|
||||||
|
<a href="{{ pagination.prev|url }}">« Previous</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="disabled">« Previous</span>
|
||||||
|
{% endif %}
|
||||||
|
| {{ pagination.page }} |
|
||||||
|
{% if pagination.has_next %}
|
||||||
|
<a href="{{ pagination.next|url }}">Next »</a>
|
||||||
|
{% else %}
|
||||||
|
<span class="disabled">Next »</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
6
lektor/templates/page.html
Normal file
6
lektor/templates/page.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
{% block title %}{{ this.title }}{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>{{ this.title }}</h2>
|
||||||
|
{{ this.body }}
|
||||||
|
{% endblock %}
|
2
lektor/ucloud.lektorproject
Normal file
2
lektor/ucloud.lektorproject
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[project]
|
||||||
|
name = ucloud
|
Loading…
Reference in a new issue