Are you over 18 and want to see adult content?
More Annotations
A complete backup of czechgaysolarium.com
Are you over 18 and want to see adult content?
A complete backup of zapinterlations.com
Are you over 18 and want to see adult content?
A complete backup of bigoliveapkmod.com
Are you over 18 and want to see adult content?
A complete backup of queenletiziastyle.com
Are you over 18 and want to see adult content?
A complete backup of smashingpumpkins.com
Are you over 18 and want to see adult content?
A complete backup of biologyjunction.com
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of https://uggsoutlet-store.com
Are you over 18 and want to see adult content?
A complete backup of https://aixmi-news.gr
Are you over 18 and want to see adult content?
A complete backup of https://ortox.ru
Are you over 18 and want to see adult content?
A complete backup of https://popfay.com
Are you over 18 and want to see adult content?
A complete backup of https://digitalmediafx.com
Are you over 18 and want to see adult content?
A complete backup of https://nortekhvac.com
Are you over 18 and want to see adult content?
A complete backup of https://rotel.de
Are you over 18 and want to see adult content?
A complete backup of https://gufw.org
Are you over 18 and want to see adult content?
A complete backup of https://peihumanesociety.com
Are you over 18 and want to see adult content?
A complete backup of https://tamiu.edu
Are you over 18 and want to see adult content?
A complete backup of https://shermanhoward.com
Are you over 18 and want to see adult content?
Text
HOME — BE GROOVIE
Look at the console in proxmox to determine the IP, and change it as desired for a static IP. Finish setup in the AWS Console for the Storage Gateway, your computer will need to be able to talk directly to the VM running the appliance VM. You will be asked to set a cache drive, select the additiona 150Gb drive. A SMALLER, FASTER, AND MORE EFFICIENT HOME SERVER A few years ago I built a home NAS and virtualization server. While I moved past SmartOS after a year or two to FreeNAS, the hard drives are aging and I realized it isn’t very efficient compared to what’savailable now.
LAN CONTAINERS IN KUBERNETES WITH RANCHER When running containers that I want available on my LAN, it’s handy to expose them under their own LAN IP. To do this I set my DHCP server to stop allocating addresses past .189, and will reserve the remaining IP addresses for container use.. To allocate LAN IP addresses for containers in Kubernetes I use MetalLB.I installed it using kubectl (Rancher makes it easy to download the kube configFILED UNDER CODE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). WSGI AND WSGI MIDDLEWARE IS EASY WSGI and WSGI Middleware is Easy. Really, its quite simple. If you already knew that, this post isn’t going to enlighten you at all. If WSGI had been one of those things you kept saying to yourself, “Oh, yea, I’ll learn that someday”, consider this a short intro to all the info a web developer and to some extent a framework author, willlikely care about.
FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeBLOG ARCHIVE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeHOME — BE GROOVIE
Look at the console in proxmox to determine the IP, and change it as desired for a static IP. Finish setup in the AWS Console for the Storage Gateway, your computer will need to be able to talk directly to the VM running the appliance VM. You will be asked to set a cache drive, select the additiona 150Gb drive. A SMALLER, FASTER, AND MORE EFFICIENT HOME SERVER A few years ago I built a home NAS and virtualization server. While I moved past SmartOS after a year or two to FreeNAS, the hard drives are aging and I realized it isn’t very efficient compared to what’savailable now.
LAN CONTAINERS IN KUBERNETES WITH RANCHER When running containers that I want available on my LAN, it’s handy to expose them under their own LAN IP. To do this I set my DHCP server to stop allocating addresses past .189, and will reserve the remaining IP addresses for container use.. To allocate LAN IP addresses for containers in Kubernetes I use MetalLB.I installed it using kubectl (Rancher makes it easy to download the kube configFILED UNDER CODE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). WSGI AND WSGI MIDDLEWARE IS EASY WSGI and WSGI Middleware is Easy. Really, its quite simple. If you already knew that, this post isn’t going to enlighten you at all. If WSGI had been one of those things you kept saying to yourself, “Oh, yea, I’ll learn that someday”, consider this a short intro to all the info a web developer and to some extent a framework author, willlikely care about.
FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeBLOG ARCHIVE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He WHY EXTENDING THROUGH SUBCLASSING (A FRAMEWORK’S CLASSES Why Extending Through Subclassing (a framework’s classes) is a Bad Idea. Ok, I’ll admit it, overly ambitious blog post. So I’ll refine it a little now, this is intended mainly as my thoughts on why as a tool developer (one who makes tools/frameworks that other programmers then use), its a bad idea to implement extensible objects via developer subclassing. BUILDING A SMARTOS SERVER Building A SmartOS Server. I’ve been reading about SmartOS for awhile now and have wanted to build a home server that would let me run VM’s with ZFS for the main file-system. Getting rid of my home theater PC and wireless router (which has been PAGE 3 — BE GROOVIE About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PYLONS 0.10 AND 1.0 BETA 1 RELEASED About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He currently works at Mozilla. NEW BLOG SOFTWARE AGAIN! New Blog Software Again! I’ve been using tumblr for awhile and while its useful when posting random stuff I should’ve posted to Facebook instead (images, links, videos, etc.), writing my text in HTML was just icky. Markdown isn’t a huge improvement and I was really itching to write all my posts in reST as I already know it quite well from writing my docs using Sphinx. HOW TO USE DATABASE AGNOSTIC SQL IN SQLOBJECT How to Use Database Agnostic SQL in SQLObject. One of the advantages to using SQLObject is that the code you write in it can easily be constructed in a way that ensures it’ll work without a problem in all the databases SQLObject supports. This is a tremendous advantage that is most useful when writing web applications intended for wide-spread deployment on a variety of systems.HOME — BE GROOVIE
Look at the console in proxmox to determine the IP, and change it as desired for a static IP. Finish setup in the AWS Console for the Storage Gateway, your computer will need to be able to talk directly to the VM running the appliance VM. You will be asked to set a cache drive, select the additiona 150Gb drive. A SMALLER, FASTER, AND MORE EFFICIENT HOME SERVER A few years ago I built a home NAS and virtualization server. While I moved past SmartOS after a year or two to FreeNAS, the hard drives are aging and I realized it isn’t very efficient compared to what’savailable now.
LAN CONTAINERS IN KUBERNETES WITH RANCHER When running containers that I want available on my LAN, it’s handy to expose them under their own LAN IP. To do this I set my DHCP server to stop allocating addresses past .189, and will reserve the remaining IP addresses for container use.. To allocate LAN IP addresses for containers in Kubernetes I use MetalLB.I installed it using kubectl (Rancher makes it easy to download the kube configFILED UNDER CODE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). WSGI AND WSGI MIDDLEWARE IS EASY WSGI and WSGI Middleware is Easy. Really, its quite simple. If you already knew that, this post isn’t going to enlighten you at all. If WSGI had been one of those things you kept saying to yourself, “Oh, yea, I’ll learn that someday”, consider this a short intro to all the info a web developer and to some extent a framework author, willlikely care about.
FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeBLOG ARCHIVE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeHOME — BE GROOVIE
Look at the console in proxmox to determine the IP, and change it as desired for a static IP. Finish setup in the AWS Console for the Storage Gateway, your computer will need to be able to talk directly to the VM running the appliance VM. You will be asked to set a cache drive, select the additiona 150Gb drive. A SMALLER, FASTER, AND MORE EFFICIENT HOME SERVER A few years ago I built a home NAS and virtualization server. While I moved past SmartOS after a year or two to FreeNAS, the hard drives are aging and I realized it isn’t very efficient compared to what’savailable now.
LAN CONTAINERS IN KUBERNETES WITH RANCHER When running containers that I want available on my LAN, it’s handy to expose them under their own LAN IP. To do this I set my DHCP server to stop allocating addresses past .189, and will reserve the remaining IP addresses for container use.. To allocate LAN IP addresses for containers in Kubernetes I use MetalLB.I installed it using kubectl (Rancher makes it easy to download the kube configFILED UNDER CODE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). WSGI AND WSGI MIDDLEWARE IS EASY WSGI and WSGI Middleware is Easy. Really, its quite simple. If you already knew that, this post isn’t going to enlighten you at all. If WSGI had been one of those things you kept saying to yourself, “Oh, yea, I’ll learn that someday”, consider this a short intro to all the info a web developer and to some extent a framework author, willlikely care about.
FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeBLOG ARCHIVE
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER RAILS
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PAGE 2 — BE GROOVIE In this case, the cached data is in a nested function with the decorator. It could of course be in the module elsewhere as well. Hook the view function up in your urls.py, and hit the view. The first time it will wait a few seconds, then it will return the old time until the cache expires (10 seconds in this case). FILED UNDER KUBERNETES About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. HeFILED UNDER MYGHTY
About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He WHY EXTENDING THROUGH SUBCLASSING (A FRAMEWORK’S CLASSES Why Extending Through Subclassing (a framework’s classes) is a Bad Idea. Ok, I’ll admit it, overly ambitious blog post. So I’ll refine it a little now, this is intended mainly as my thoughts on why as a tool developer (one who makes tools/frameworks that other programmers then use), its a bad idea to implement extensible objects via developer subclassing. BUILDING A SMARTOS SERVER Building A SmartOS Server. I’ve been reading about SmartOS for awhile now and have wanted to build a home server that would let me run VM’s with ZFS for the main file-system. Getting rid of my home theater PC and wireless router (which has been PAGE 3 — BE GROOVIE About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He PYLONS 0.10 AND 1.0 BETA 1 RELEASED About. Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such as Pylons, Beaker, and Routes. He currently works at Mozilla. NEW BLOG SOFTWARE AGAIN! New Blog Software Again! I’ve been using tumblr for awhile and while its useful when posting random stuff I should’ve posted to Facebook instead (images, links, videos, etc.), writing my text in HTML was just icky. Markdown isn’t a huge improvement and I was really itching to write all my posts in reST as I already know it quite well from writing my docs using Sphinx. HOW TO USE DATABASE AGNOSTIC SQL IN SQLOBJECT How to Use Database Agnostic SQL in SQLObject. One of the advantages to using SQLObject is that the code you write in it can easily be constructed in a way that ensures it’ll work without a problem in all the databases SQLObject supports. This is a tremendous advantage that is most useful when writing web applications intended for wide-spread deployment on a variety of systems.* Home
*
B
BE GROOVIE
ABOUT
Ben Bangert is a San Francisco Bay Area programmer, best known for his open-source work creating and contributing to Python libraries such asPylons , Beaker ,
and Routes .
He currently works at Mozilla.QUICK SEARCH
Enter search terms or a module, class or function name.ELSEWHERE
Follow me on twitterCATEGORIES
* AppleScript (1)
* Code (43)
* Kubernetes (3)
* Myghty (10)
* OpenIndiana (1)
* Perl (4)
* Pylons (17)
* Python (74)
* Rails (9)
* Rants (16)
* Routes (11)
* Ruby (6)
* SmartOS (2)
* sphinx (1)
* Thoughts (37)
RECENT POSTS
* Argo Tunnel in Kubernetes * Lan Containers in Kubernetes with Rancher * A Smaller, Faster, and More Efficient Home Server * Trying out SmartOS and OpenIndiana * Building A SmartOS Server * New Blog Software Again! * Notes on the Pylons & repoze.bfg Merger * Why Extending Through Subclassing (a framework's classes) is a BadIdea
* Pylons 0.10 and 1.0 Beta 1 Released * Deploying Python web apps with toppcloud* Older »
September 17, 2019
ARGO TUNNEL IN KUBERNETESNote
Part of a series of more. I don’t know how much more yet as this is primarily written to document my setup so I can refer to it later when I wonder why/how I did something. To get the Argo Tunnel working in Kubernetes, we need to first install helm on the computer we run kubectlfrom. I use
a debian based system for this, so these commands are the appropriate ones for a recent debian that has snap.Install helm:
$ sudo snap install helm --classic Configure a service account with cluster-admin role by sticking this into a rbac-config.yaml file:apiVersion: v1
kind: ServiceAccountmetadata:
name: tiller
namespace: kube-system---
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBindingmetadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.iokind: ClusterRole
name: cluster-adminsubjects:
- kind: ServiceAccountname: tiller
namespace: kube-system Apply the configuration to the cluster: $ kubectl create -f rbac-config.yamlInitialize helm:
$ helm init --service-account tiller --history-max 200 Now we’re ready to add the cloudflared ingress controller: $ helm repo add cloudflare https://cloudflare.github.io/helm-charts $ helm repo update $ helm install --name anydomain --namespace default \ --set rbac.create=true \ --set controller.ingressClass=argo-tunnel \ --set controller.logLevel=6 \ cloudflare/argo-tunnel Install cloudflared from here.
Then run cloudflared login and put the cert in ~/.cloudflared/cert.pm. Create a secret for this domain: $ kubectl create secret generic DOMAIN --from-file="$HOME/.cloudflared/cert.pem" The rest of the Argo instructions for an Ingress definition should all work fine now. Posted by Ben Bangert Filed under: KubernetesSeptember 11, 2019
LAN CONTAINERS IN KUBERNETES WITH RANCHERNote
Part
of a series of more. I don’t know how much more yet as this is primarily written to document my setup so I can refer to it later when I wonder why/how I did something. When running containers that I want available on my LAN, it’s handy to expose them under their own LAN IP. To do this I set my DHCP server to stop allocating addresses past .189, and will reserve the remaining IP addresses for container use. To allocate LAN IP addresses for containers in Kubernetes I use MetalLB . I installed it using kubectl (Rancher makes it easy to download the kube config file). Then I setup a ConfigMap YAML:apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-systemname: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.2.190-192.168.2.254And applied with:
$ kubectl apply -f metallb_config.yamlUNIFI CONTROLLER
I’m changing the IP of where the existing Unifi controller runs, which comes with an interesting drawback. All the existing Unifi devices need to start reporting to the new controller. First, login to existing controller, and download a full backup. Then setup the new controller, my unifi-controller.yaml looks like this:apiVersion: apps/v1
kind: Deployment
metadata:
name: unifi-controller-deploymentspec:
replicas: 1
selector:
matchLabels:
app: unifi-controllertemplate:
metadata:
labels:
app: unifi-controllerspec:
containers:
- name: unifi-controller image: jacobalberty/unifi:5.11 imagePullPolicy: IfNotPresentresources:
requests:
memory: "32Mi"
cpu: "100m"
limits:
memory: "8G"
cpu: "6000m"
ports:
- name: "l2-discoverable"containerPort: 1900
protocol: UDP
- name: "stun"
containerPort: 3478
protocol: UDP
- name: "ap-discovery" containerPort: 10001protocol: UDP
- name: "speed-test"containerPort: 6789
- name: "internal-comms"containerPort: 8080
- name: "unknown-port"containerPort: 8081
- name: "http-web"
containerPort: 8443
- name: "http-s-redirect"containerPort: 8843
- name: "http-redirect"containerPort: 8880
volumeMounts:
- mountPath: /unifi
name: vol1
volumes:
- hostPath:
path: /mnt/data/unifi-controller type: DirectoryOrCreatename: vol1
---
apiVersion: v1
kind: Service
metadata:
name: unifi-controller-service-tcpannotations:
metallb.universe.tf/allow-shared-ip: uckeyspec:
type: LoadBalancer
externalTrafficPolicy: Local loadBalancerIP: 192.168.2.190selector:
app: unifi-controllerports:
- name: "speed-test"protocol: TCP
targetPort: 6789
port: 6789
- name: "internal-comms"protocol: TCP
targetPort: 8080
port: 8080
- name: "unknown-port"protocol: TCP
targetPort: 8081
port: 8081
- name: "http-web"
protocol: TCP
targetPort: 8443
port: 8443
- name: "http-s-redirect"protocol: TCP
targetPort: 8843
port: 8843
- name: "http-redirect"protocol: TCP
targetPort: 8880
port: 8880
- name: "local-comms"protocol: TCP
targetPort: 27117
port: 27117
---
apiVersion: v1
kind: Service
metadata:
name: unifi-controller-service-udpannotations:
metallb.universe.tf/allow-shared-ip: uckeyspec:
type: LoadBalancer
externalTrafficPolicy: Local loadBalancerIP: 192.168.2.190selector:
app: unifi-controllerports:
- name: "l2-discoverable"protocol: UDP
targetPort: 1900
port: 1900
- name: "stun"
protocol: UDP
targetPort: 3478
port: 3478
- name: "ap-discovery"protocol: UDP
targetPort: 10001
port: 10001
---
apiVersion: networking.k8s.io/v1kind: NetworkPolicy
metadata:
name: allow-all
spec:
podSelector: {}
egress:
- {}
policyTypes:
- Egress
view raw
unifi-controller.yaml hosted with ❤ by GitHub I created a namespace for unifi in the Rancher UI, where I’ll run myUnifi containers.
To spin up the container on its new IP: $ kubectl -n unifi apply -f unifi-controller.yaml This can take a few minutes to come-up, it has to play with ARP responses and such. Once the new Unifi controller was up, I restored the backup and logged in. None of the devices will show up.... yet! On the old Unifi controller, I went to Settings -> Site and clicked the Export Site button. You can download a backup file here, but the more important step is to migrate the devices to the new controller by providing the new IP for them to inform. Once this step is done, the devices should show up in the new controller shortly. The old controller can then be shutdown. UNIFI VIDEO CONTROLLER I used this kubernetes file to setup my unifi video controller:apiVersion: apps/v1
kind: Deployment
metadata:
name: unifi-video-deploymentspec:
replicas: 1
selector:
matchLabels:
app: unifi-video
template:
metadata:
labels:
app: unifi-video
spec:
containers:
- name: unifi-controller image: pducharme/unifi-video-controller:3.10.6 imagePullPolicy: IfNotPresentenv:
- name: TZ
value: America/Los_Angelesresources:
requests:
memory: "32Mi"
cpu: "100m"
limits:
memory: "8G"
cpu: "6000m"
securityContext:
capabilities:
add:
- SYS_ADMIN
- DAC_READ_SEARCH
ports:
- name: "rtmp"
containerPort: 1935
- name: "http-web-ui"containerPort: 7080
- name: "nvr-talk"
containerPort: 7442
- name: "https-web-ui"containerPort: 7443
- name: "other-video"containerPort: 7444
- name: "video-http"containerPort: 7445
- name: "video-https"containerPort: 7446
- name: "rtsp-via-ctlr"containerPort: 7447
- name: "inb-cam-streams"containerPort: 6666
- name: "nvr-discovery" containerPort: 10001volumeMounts:
- mountPath: /var/lib/unifi-videoname: vol1
- mountPath: /var/lib/unifi-video/videosname: vol2
volumes:
- hostPath:
path: /mnt/data/unifi-video/data type: DirectoryOrCreatename: vol1
- hostPath:
path: /mnt/data/unifi-video/videos type: DirectoryOrCreatename: vol2
---
apiVersion: v1
kind: Service
metadata:
name: unifi-video-servicespec:
type: LoadBalancer
externalTrafficPolicy: Local loadBalancerIP: 192.168.2.192selector:
app: unifi-video
ports:
- name: "rtmp"
port: 1935
- name: "http-web-ui"port: 7080
- name: "nvr-rpt"
port: 7442
- name: "https-web-ui"port: 7443
- name: "7444-talk"
port: 7444
- name: "video-http"port: 7445
- name: "video-https"port: 7446
- name: "rtsp-via-ctlr"port: 7447
- name: "inbd-cam-streams"port: 6666
- name: "nvr-discovery"port: 10001
view raw
unifi-video.yaml
hosted with ❤ by GitHub I’m using the /mnt/data directory that is the second SATA SSD drive for these containers to store their data on. After restoring this from the backup I made of my old unifi video controller, I logged in, selected the camera, and under Manage I changed its reporting IP to the new container IP. Posted by Ben Bangert Filed under: KubernetesSeptember 09, 2019
A SMALLER, FASTER, AND MORE EFFICIENT HOME SERVERNote
Part
of a series of more. I don’t know how much more yet as this is primarily written to document my setup so I can refer to it later when I wonder why/how I did something. A few years ago I built a home NAS and virtualization server. While I moved past SmartOS after a year or two to FreeNAS, the hard drives are aging and I realized it isn’t very efficient compared to what’s available now. From my prior post, the hard drives were replaced with 6 4TB drives in a ZRAID-2. This ended up giving me vastly more space than I had any need for and as I now have a 1Gbps fiber line I don’t feel the need to store 16 TB locally. Given my Internet connectivity and increased focus in my spare time on containerized applications using Kubernetes, I figured it might be a good time to ‘downsize’ in power consumption while increasing my virtualization capabilities. The new server configuration I ended up with is a fraction of the size (half-length 1U vs full-length 2U) and power (190w idle vs 40w idle), while having 4x the cores and over 8x the memory capacity. 7 years has definitely helped on what you get forthe same price!
SYSTEM SPECS
It took awhile before Epyc embedded processors and vendors 1U systems started to hit the market, but the 8-core/16-thread Epyc 3251 in a nice half-length 1U is now widely available. Serve The Home did a great review of this system which helped convince me to purchase one. Here are specs for this build: * CPU/MOTHERBOARD: AMD Epyc Embedded 3251 (8-core / 16-thread) on Supermicro M11SDV-8C-LN4F * CASE: Supermicro AS 5019D-FTN4 * RAM: Supermicro DDR4-2666 64 GB ECC LRDIMM x2 (128 GB total) * NVME DRIVE: Samsung 970 Evo Plus 1TB * SATA DRIVE: Sandisk Ultra 3D 2TB Overall cost: ~$2100 This is a bit more than the last buuild, but is 100% SSD storage without any redundancy. I’m relying on cloud backups and accepting that I will have some downtime if a part fails. I consider this an acceptable trade-off to keep costs lower with the hope that once a SSD has proven itself for a few months it should last much longer than a spinning platter drive as I don’t anticipate heavy read/write loads that would wear out the drives.Note
In the event an SSD fails, I’m only a 10min drive from a Best Buy where I got both the SSD’s. I consider this a more likely failure scenario than the PSU, CPU, memory, or motherboard failing in my experience (I already ran a memtest suite against the memory before installing proxmox, which comes with memtest on their live ISO). If I really go nuts with VM’s and containers I still have 2 DIMM slots free for another 128 GB of memory. I’ve found that for personal use containers usually run into RAM pressure much earlierthan CPU pressure.
OS CHOICE
I’ve been reading a lot of Serve the Home , and their glowing review of Proxmox VE convinced me to give it a try. I’ve been enjoying it so far and it’s easy to get started with and makes running KVM a breeze.PROXMOX VE it is!
I grabbed the ISO for installing ProxMox 6.0, based on a buster debian distro. Using the ISO directly from my computer was rather easy from the Supermicro IPMI Java interface. While the ikvm HTML5 interface is more convenient, the Java-based console makes it a breeze to attach local .iso files as a CD/DVD drive to the server. I’m running the community edition, which requires you to edit the /etc/apt/sources.list to include the non-enterprise deb:
deb http://download.proxmox.com/debian/pve buster pve-no-subscriptionAdditional steps:
*
From the shell in the web UI:apt-get update
apt-get dist-upgrade -yreboot
*
Add the additional drive as a new lvm-thin poolNote
I have set all the VM hard drives under the default lvm-thin pool which is on the NVMe SSD for performance. The SATA SSD is to be used for persistent data volumes for containers. AWS STORAGE APPPLIANCE The first thing I wanted to try was utilizing hybrid storage in AWS with their Storage Appliance. Unfortunately AWS only provides a VMWare image. I found a few articles online that indicated this was rather easy to convert to a raw disk image for use in Proxmox, and got it working rather quickly.*
Download the AWS Storage Gateway zipfile*
Unzip the zipfile (resulting in an .ova file)*
tar xf AWS-Appliance-2019-07-24-1563990364.ova (Filename dependent ontime it was d/l)
*
qemu-img info AWS-Appliance-2019-07-24-1563990364-disk1.vmdk and record the virtual size to use when provisioning a proxmox KVM*
Provision a Proxmox VM with the given size disk, using an IDE disk emulation target. I gave my VM 16GB of memory, as I wasn’t sure howmuch it would want.
*
Determine the location of the LVM disk used by the new VM (something like /dev/pve/vm-100-disk-0).*
Convert the vmware disk image to the raw: qemu-img convert -f vmdk -O raw AWS-Appliance-2019-07-24-1563990364-disk1.vmdk /dev/pve/vm-100-disk-0*
Edit the VM hardware to add the LVM-thin drive resource. I added a 150Gb hard drive as another IDE resource per AWS recommendations forlocal cache size.
*
Start the VM.
*
Look at the console in proxmox to determine the IP, and change it as desired for a static IP.*
Finish setup in the AWS Console for the Storage Gateway, your computer will need to be able to talk directly to the VM running the appliance VM. You will be asked to set a cache drive, select the additiona 150Gbdrive.
PROS
* Fast access to frequently accessed files that fit within the cache * Everything backed by S3 reliability * As much storage as you want to pay for * It’s fun to see that your SMB share has 7.99 Exabytes freeCONS
* Unavailable when the Internet is out * Slower access than a NAS * SMB requires an Active Directory server for user based permissions or a single guest account with read/write access to all SMB shares. * NFS shares have similarly odd restrictionsRANCHEROS
I followed these directions to install RancherOS under ProxMox VE. Reproduced here with a fix to the cloud-config.yml as the example didn’t validate. * Download RancherOS ISO * Upload the iso to (local)pve * Setup a VM with RancherOS ISO as CD. Give it at least 3gb ram to start. Rancher Server failed with low ram* Boot
* From Console change password* sudo bash
* passwd rancher
* SSH to rancher@
* prepare your ssh keys with putty gen or local ssh key-gen * vi cloud-config.yml * paste the cloud config edited with your settings, make sure the pasted data is pated correctly, add your key in a single line * press exit exit :wq to save> #cloud-config
>
> rancher:
> network: > interfaces: > eth0: > address: 10.68.69.92/24 > gateway: 10.68.69.1 > mtu: 1500 > dhcp: false > dns: > nameservers: > - 1.1.1.1 > - 8.8.4.4>
> ssh_authorized_keys: > - ssh-rsaRANCHER
With RancherOS running happilly, its time to install Rancher on the VM. This is relatively easy, from the RancherOS VM shell, just run: sudo docker run -d --restart=unless-stopped -p 8080:80 -p 8443:443 -v rancher:/var/lib/rancher rancher/rancher:stable Mapping port 80/443 to different local ports is to avoid intereference from the ingress proxy which will be running on this same node. Once Rancher is available on port 8443: * Add a cluster, of custom type. * Name it, and hit next. * Select all three node options (etcd, Control Plane, Worker) * Copy the command shown and run it in the RancherOS shell. * Click Done in the Rancher UX. * The cluster will become available.SETUP THE SATA SSD
I want to use the SATA SSD for persistent volumes for the containers:*
Add a hard drive in Proxmox VE to RancherOS VM*
Choose a sufficient size (I choose 400 GB)*
Start the RancherOS VM (or restart it)*
Verify additional hard drive appears in fdisk -l*
Format the hard drive with fdisk /dev/sdb*
Choose new partition, primary, select default start/end values*
Format the partition with mkfs.ext4 /dev/sdb*
Set it to load at start in RancherOS: ros config set mounts ''*
Reboot and verify /mnt/data is a volume mount.FIN
That’s it for a first day of configuring things. Next up I’ll need to setup MetalLB so that my Kubernetes containers I start with Rancher get LAN IP’s rather than shuttling everything through the default nginx ingress. Posted by Ben Bangert Filed under: KubernetesSeptember 17, 2012
TRYING OUT SMARTOS AND OPENINDIANA After _building my new server_ capable of running SmartOS , it was time to giveit a spin!
If you’ve only built desktop machines, its hard to express how awesome IPMI KVM is. No longer do you need to grab another keyboard / video monitor / mouse (the KVM), you just plug in the IPMI Ethernet port on the motherboard to your switch and hit the web-server its running. It then lets you remotely access the machine as if you had it hooked up directly. You can get into the BIOS, boot from ISO’s on your local machine, hard reset, power down, power up, etc. It’s very slick and means I can stick the computer in the rack without needing to go near it to do everything that used to require a portable set of additional physical hardware.Note
This post assumes some basic knowledge of OS virtualization. In thiscase QEMU , KVM
(which was ported by Joyent to run on SmartOS ), and Zones. I generally refer
to them as VM’s and will differentiate when I add a Zonevs. a KVM
instance.
FIRST GO AT SMARTOS
INSTALLATION IS RIDICULOUSLY EASY, THERE IS NONE. You download SmartOS , put it on a USB stick or CD-ROM, and boot the computer from it. I was feeling especially lazy and used the motherboards IPMI KVM interface to remotely mount the ISO image directly from my Mac. Once SmartOS booted, it asked me to setup the main ZFS pool, and it was done. SmartOS runs a lot like a VMWare ESXI hyper-visor, with the assumption that the machine will only be booting VM’s. So the entire ZFS pool is just for your VM’s, which I appreciate greatly. After playing with it a little bit, it almost felt.... too easy. I had really allocated at least a week or two of my spare time to fiddle around with the OS before I wanted it to _just work_, and having it running so quickly was almost disappointing. The only bit that was slightly annoying was that retaining settings in the GZ (Global Zone) is kind of a pain. You have to drop in a service file (which is XML, joy!) on a path which SmartOS will then load and run on startup. This was mildly annoying, and some folks on the IRC channel suggested I give OpenIndiana a spin, which is aimed more at a home server / desktop scenario. There was also a suggestion that Igive Sophos UTM
a spin instead of pfsense for the firewall /router VM.
OPENINDIANA
Since OpenIndiana has SmartOS ‘s QEMU/KVM functionality (needed to run other OS’s like Linux/BSD/Windows under an illumos based distro), it seemed worth giving a go. It actually installs itself on the system unlike SmartOS , so I figured it’d take a little more space. No big deal. Until I installed it. Then I saw that the ZFS boot pool can’t have disks in it larger than 2TB (well, it can, but it only lets you use 2TB of the space). Doh. After chatting with some IRC folks again, its common to use two small disks in a mirror as a ZFS boot pool and then have the much larger storage pool. Luckily I had a 250GB drive around so I could give this a spin, though I was bummed to have to use one of my drive bays just for a boot disk. Installation went smoothly, but upon trying to fire up a KVM instance I was struck by how clunky it is in comparison to SmartOS . Again, this difference comes down to SmartOS optimizing the heck out of its major use-case.... virtualizing in the data-center. In SmartOS there’s a handy imgadmtool to manage
available images, and vmadm to manage VM’s. These don’t seem to exist for OpenIndiana (maybe as an add-on package?), so you have to use the less friendly QEMU/KVM tools directly. Then the KVM failed to start. Apparently the QEMU/KVM support in OpenIndiana (at least for my Sandy Bridge based motherboard) has been broken in the latest 3 OpenIndiana releases for the past 5 months . There’s a work-around to install a specific set of packages, but to claim QEMU/KVM support with such a glaring bug in a fairly prominent motherboard chip-set isn’t a good first start. My first try to install the specific packages failed as my server kernel-panicked halfway through the QEMU/KVM package installation. Upon restarting, the package index was apparently corrupted. The only way to fix it is to re-install OpenIndiana ... or rollback the boot environment (a feature utilizing ZFS thus including snapshots). Boot environments and the beadm tool to manage them are a bit beyond the scope of this entry, but the short version is that it let me roll-back the boot file-system including the package index to a non-mangled state (Very cool!). With QEMU / KVM finally installed and working, I installed and configured Sophos UTM in a KVM and was off and running. Except it seemed to run abysmally slow... oh well, I was about to go on vacation anyways. I set the KVM to load at boot-time and restarted. Upon loading the KVM at boot, the machine halted. This issue is apparently related to the broken QEMU / KVM packages. It was about time for my vacation, and I had now played with an OS with some rather rough edges in my spare time for a week. So I powered it off, took out the boot drive, and went on my vacation.BACK TO SMARTOS
When I got back from my vacation, I was no longer in the mood to deal with failures in the OS distribution. I rather like the OpenIndiana community, but now I just wanted my server to work. SmartOS fit the bill, and didn’t require boot drives which was greatly appreciated. It also has a working QEMU / KVM, since its rather important to Joyent. :) In just a day, I went from a blank slate to a smoothly running SmartOS machine. As before, installation was dead simple, and my main ZFS pool zones (named as such by SmartOS ) was ready for VM’s. Before I added a VM I figured I should have an easy way to access the ZFS file-system. I turned on NFS for the file-systems I wanted to access and gave my computer’s IP write privilege and the rest of the LAN read-only. This is insanelyeasy in ZFS :
zfs set sharenfs=rw=MYIP,ro=192.168.2.0 zones/media/Audio To say the least, _I love ZFS_. Every other file-system / volume manager feels like a relic of the past in comparison. Mounting NFS file-systems on OSX used to suck, but now its a breeze.
They work fast and reliably (thus far at least). SETTING UP THE ROUTER KVM First, I needed my router / firewall KVM . I have a DSL connection, so I figured I’d wire that into one NIC, and have the other NIC on the motherboard go to the LAN. SmartOS virtualizes these so that each VM gets its own Virtual NIC (VNIC), this is part of the Solaris feature- set called Crossbow. Setting up
the new KVM
instance for Sophos UTM was simple, I gave it a VNIC on the physical interface connected to the DSL modem and another on the physical interface connected to myswitch.
Besides for the fact that the VM was working without any issues like I had in OpenIndiana , I noticed it was much faster as well. Unfortunately for some reason it wasn’t actually routing my traffic. It took me about an hour (and clearing the head while walking the dog) to see that I was missing several importantVNIC config options
,
such as dhcp_server, allow_ip_spoofing, allow_dhcp_spoofing, and allow_restricted_traffic. These settings are needed for a VM that intends to act as a router so that it can move the packets and NAT them as appropriate across the VNICs. Once I set those everything ran smoothly. So far, this only took me about 3 hours and was rather simple so I decided to keep going and get a nice network backup for the two OSX machines in the house. SETTING UP NETWORK BACKUPS After some research I found out the latest version of netatalk would work quite nicely for network Time Machine backups. I created a zones/tmbackups ZFS file-system, and two nested file-systems under that for my wifes’ Macbook and my own Mac Mini. Then I told ZFS that zones/tmbackups should have compression enabled (Time Machine doesn’t actually compress its backups, transparent ZFS file compression FTW!) and I set quota’s on each nested file-system to prevent Time Machine fromexpanding forever.
Next I created a Zonewith a SmartOS
Standard dataset
.
Technically, the KVM instances run in a Zonefor additional
resource constraints and security, while I wanted to use just a plain Zone for the network backups. This was mainly because I wanted to make the zones/tmbackups file-system directly available to it without having to NFS mount itinto a KVM .
If you’ve ever compiled anything from source in Solaris, you’re probably thinking about how many days I spent to get netatalk running in a Zone right now. Thankfully Joyent has done an awesome job bringing a lot of the common GNU compiler toolchain to SmartOS . It only took me about an hour to get netatalk running and recognized by both macs as a valid network Time Machine backup volume. Unfortunately I can’t remember how exactly I set it up, but here are the pages that gave me the guidance I needed:*
http://www.trollop.org/2011/07/23/os-x-10-7-lion-time-machine-netatalk-2-2/ * http://wiki.openindiana.org/oi/Netatalk * http://marcoschuh.de/wp/?p=839 I’ve heard that netatalk 3.x is faster, and will likely upgrade thatone of these days.
SETTING UP THE MEDIA SERVER KVM One of the physical machines I wanted to get rid of was the home theater PC I had built a few years back. It was rarely used, not very energy efficient, and XBMC was nowhere near spouse-friendly enough for my wife. We have an AppleTV and Roku , and I figured I’d give Plexa try on the Roku
since the UI was so simple. I setup a KVM instance and installed Ubuntu 12.04 server on it. Then I added the Plex repo’s and installed their Media Server packages. Fired it up and pointed Plex at my Video folders and it was ready to go. The Roku interface is slick and makes it a breeze to navigate. Being based on XBMC means that it can play all the same media and trans-codes it as necessary for the other network devices that want toplay it.
At first Plex ran into CPU problems in the KVM ... which I quickly realized was because I hadn’t changed the default resource constraints. The poor thing only had a single virtual CPU... after giving it a few more it easily had enough CPU allocated to do thevideo trans-coding.
While KVM runs CPU-bound tasks at bare-metal speed, disk I/O is virtualized. To reduce this problem I have Plex writing its trans- coded files to the ZFS file-system directly via an NFS mount. The media folders are also NFS mounted into the Media Server KVM. I threw some other useful apps onto this KVM that I was running on the home theater PC and left it alone.SMARTOS ROCKS
I now have a nice little home SmartOS server setup running that does a great job taking on jobs previously done by 2 other pieces of hardware. I still need to setup a base Ubuntu image to use for other development KVM’s, which I’ll blog about when I get that going. Despite being intended for the data-center, SmartOS works great for a home NAS / Media Server / Router system. I’m sure I’ll be even happier as I start to ramp up my use of development VM’s. OpenIndiana is a small community taking on a big job. It’s a great community and people are very friendly. But you should expect to be hacking on things very early on if you use it, rather than playing with the other components. The SmartOS community is doing great too, and there’s more than a few forks that add some additional home-centric type functionality. So far I haven’t needed any of those enough to get meto try them out.
Anything else I should blog about regarding SmartOS or the rest of my setup? Posted by Ben Bangert Filed under: SmartOS , OpenIndianaSeptember 16, 2012
BUILDING A SMARTOS SERVER I’ve been reading about SmartOS for awhile now and have wanted to build a home server that would let me run VM’s with ZFS for the main file-system. Getting rid of my home theater PC and wireless router (which has been annoying me with its flakiness for months) was also a goal. Running something like pfsense in a VM would give me more options and theoretically be more stable than the fairly crappy software that seems to plague home consumer-grade wireless routers. So after a month or so of research in my spare time, it seemed like SmartOS was going to be the best bet. Even though its generally intended for use in the datacenter, it had all the features I wanted (which I’ll blog about separately in my next post). Now I just needed a parts list that had already been verified to work with SmartOS , which is a bit pickier on hardware than the linux/BSD distributions.EQUIPMENT
Here’s what I ended up with: * CPU: Intel Xeon E3-1230 V2 * MOTHERBOARD: SUPERMICRO MBD-X9SCL-F-O * CASE: NORCO RPC-2212 Black 2U Rackmount Server Case with 12 Hot-Swappable SATA/SAS Drive Bays * HBA: LSI Internal SATA/SAS 9211-8i (Hooks up to 2 of the back-plane connectors in the case for 8 drives) * RAM: 16GB ECC (The 8 GB unbuffered sticks were unfortunately not around at the time or I would’ve gotten two of those to begin with) I already had a 2TB and 3TB drive, so I bought one more of each so that I could run a ZFS storage pool with 2 vdev mirrors as Constantin Gonzalez blogs about regarding RAID vs. mirrors.
In retrospect, and after reading a bit more, I think I would’ve gotten one of the larger Norco 4U cases. Not because I need or want 20+ hot-swap bays, but because you can easily use a ‘desktop’ grade 80+ Titanium rated power supply. Finding a 2U 80+ PSU is difficult, a 80+ Titanium rated that puts all its power out on a single 5v rail is almost impossible. The cost savings in getting a good desktop-grade PSU with the Norco 4U case is about the same as the one I got with the more expensive 2U PSU. I also bought a rack to put the server in along with my other home networking gear, so that it’d all be nicely packed away in a corner of the garage. Here’s a photo of the completed setup: I have one of the cheaper Cisco SG300-10 switches which conveniently came with rack-mounts, and monoprice had a very affordable patch panel and blank plates to make it look tidy. Overall cost: ~$2200 That includes the nice Tripp Lite SR12UB 12U Rack Enclosure which I’ve found handy to lock to ensure my toddler doesn’t yank out hard drives (he figured out how to pull out the hot-swap drive in all of 20 seconds when I was assembling it). Not that I let him run around the garage, but keeping everything locked is handy just incase.
OS CHOICE
When I was assembling and preparing to install SmartOS , some people on IRC mentioned that OpenIndiana might be a better choice for a home server. Suffice it to say it didn’t work out well, while SmartOS has been flawless now and running smoothly for the past two months. My next post will have a lot more details on my OpenIndiana experience as well as how I have the SmartOSbox setup.
Posted by Ben Bangert Filed under: SmartOSMarch 26, 2012
NEW BLOG SOFTWARE AGAIN! I’ve been using tumblr for awhile and while its useful when posting random stuff I should’ve posted to Facebook instead (images, links, videos, etc.), writing my text in HTML was just icky. Markdown isn’t a huge improvement and I was really itching to write all my posts in reST as I already know it quite well from writing my docs using Sphinx . I considered using blogofile , but it seems to be abandoned and it’s not trivial to add normal reST style code highlighting. Then I saw tinkerer , which is basically just a few extensions on top of Sphinx ... perfect!THE MIGRATION
For anyone considering migrating from tumblr , here’s my simple dump script that pulled all my posts I cared about out of tumblr and dropped them into directoriesfor tinkerer
import json
import re
import os
import subprocess
import requests
date_regex = re.compile(r'(?Preturn posts
def html2rst(html): p = subprocess.Popen(, stdin=subprocess.PIPE, stdout=subprocess.PIPE) return p.communicate(html) def dump_posts(posts):post_links =
for post in posts: if post not in :continue
d = date_regex.match(post).groupdict() os.system("mkdir -p %s/%s/%s" % (d, d, d)) slug = post.split('/').replace('-', '_') link = '%s/%s/%s/%s' % (d, d, d, slug) post_links.append(link) bar = '=' * len(post) with open('%s.rst' % link, 'wb') as f:print post
f.writelines()
if post == 'text': body = html2rst(post.encode('utf-8').replace('’', "'"))f.writelines()
elif post == 'link': desc = html2rst(post.replace('’', "'").encode('utf-8'))f.writelines()
f.write(desc + '\n\n'),f.writelines()
return post_links
It’s quite nice that I get all the Sphinx extensions for use in my blog, and there’s no more mental context switching to write a blog post vs. writing project documentation for my open-source projects. Dropping a graphviz diagram into my blog also became trivial.THE BAD NEWS
It’s not perfect, tinkerer is still very beta. But I can wrap my head around it, and its easy to extend. I’ve already made a little modification in my own fork which allows me to specify URL’s for the comments to ensure I get the right disqus threads on the old blog posts I ported. This wasn’t a flawless process due to how the main reactions and comments thing on the main pages look, they’re a bit off for the legacy posts... but at least the comments and such show up fine once you click in so I’ll live with it. There’s no category specific RSS feeds at the moment, so I’ll need to hack that in so that I can get relisted on the Python aggregators. I also will likely update the theme, right now I’m just using ‘minimal’ which isn’t bad. Since this is more for just posts, I dropped the other tumblr things like links and videos to retain just CONTENT. I don’t think this is too negative but some might want all the types tumblr supports. Overall, I’m quite happy with it thus far. We’ll see how I feel in a few months, and hopefully I’ll be blogging more since there’s less friction involved since I get to use the Sphinx tools I’m quite familiar with. Posted by Ben Bangert Filed under: Python , sphinxNovember 13, 2010
NOTES ON THE PYLONS & REPOZE.BFG MERGER Some folks might not have time to follow the Pylons-discuss mail list, so this might be news to them, but I’m thrilled to announce that the Pylons and repoze.bfg web frameworks are merging. If this is the first you’ve heard about it, don’t worry, it was only announced a week ago now on the Pylons mail list. In the time since the announcement, I’ve heard a lot of varying feedback. Some people took a look at Pyramid (the core package that will be equivilant to ‘Pylons 2.0’) and were quick to respond, usually in a knee-jerk type response. I think some of this was due to a miscommunication, and partly because there was so much already done. When other frameworks have merged in other languages, such as Rails merging with Merb, the announcement was just that. There was no code at the time to show, just a promise that when it was ready, it wouldbe awesome.
This merger in contrast already had a starting foundation for a huge chunk of the core features. As a result, people assumed that what we had was already ‘finished’, or close to it. The polish of much of the documentation made it feel odd that there was no “Porting Pylons 1.0 to Pyramid” guide done. In reality, Pyramid is DEFINITELY NOT DONE, there is still quite a bit of work left before Pyramid will meet the expectations that many Pylons users have. There’s still refinements to be done to Pyramid, and additional packages that Pylons users will most likely always use with it for the feature-set they’re accustomed to. I’ve summed up a few thoughts on when Pylons users should port toPyramid
to try and help manage expectations better in the future. I’ll make more announcements when packages are ready to ease the transition and a “Porting Guide” is ready.WHAT IS PYLONS?
Many Pylons users don’t realize which features they enjoy come from the package ‘pylons’ vs. the other packages that Pylons depends on. Contrary to popular belief the majority of features present in Pylons actually come from other packages. This mistaken belief that most of the features come from the pylons package led some to think that because a lot of my future development time will be spent on adding features/packages around pyramid, Pylons is somehow _dead>_. This is not the case. First, Pylons the web framework is mainly a small (~ 1000 LoC) glue layer between Paste, PasteScript, PasteDeploy, WebOb, WebError, Routes, WebHelpers, Mako, and SQLAlchemy. Some people usually end up swapping out Mako/SQLAlchemy but by and large this is the common ‘Pylons Stack’. Most of the new features in Pylons over the past several years actually came from additions to WebHelpers, WebError, or Routes. All of these packages continue to get the same development as they have, so no ‘death’ is occurring. Second, for over the past 6 months now, there’s been very little in the way of patches submitted, bugs reported, or other feature requests. In many ways Pylons is ‘done’ regarding adding more feature to the core package itself. As I announced on the Pylons-discuss mail list,
the Pylons code-base hit some design issues. Adding the features I heard requested from quite a few users (and needed myself) regarding extensibility couldn’t be retro-fitted into the existing design. I encourage anyone curious to read my prior entry on sub-classing for extensibility to be a preview of some future blog posts. I’ll be writing more about design patterns in Python that handle extensibility which many popular Python web frameworks are also struggling tohandle.
THE FUTURE
I’m very excited about the future for the Pylons Project, which is the new over-arching organization that will be developing Python web framework technologies. The core will be Pyramid, with additional features and functionality building around that. We’re already quickly expanding the developer team with some long-time contributors and having a combined team has definitely helped us progress rapidly. One of my main goals is to encourage and ease contributions from the community. To that extent I’ve been filling in the contributing section for the Pylons Project as much as possible. I believe this is an area that will quickly set us apart from other projects as we emphasize a higher standard of Python development. Django did a good job setting the bar high for its documentation of how to contribute to Django, which
deserves a lot of credit for clearly defining community policies. Its missing a portion we considered extremely valuable which core developers generally get very picky on when accepting patches… how to TEST YOUR CODE. The Pylons Project adapted the rather thorough testing dogma noted by Tres Seaver , which I personally can’t recommend highly enough when it comes to writing unit tests. It’d be nice to see more posts expand on exactly _how to test your code_. Many developers (including myself) can write code that passes 100% test coverage… but is it brittle test code? Prone to failure if some overly clever macro it uses fail? Seeing a well written set of examples on designing unit tests to avoid common gotcha’s is definitely something anyone contributing (and developers in general) should be familiar with. For those wanting a gentler introduction to Pyramid (the docs are very verbose and detailed, not at all opinionated), I’ll be blogging more about new features and how to utilize them. Please be patient, I think a lot of people are going to be excited at what’s in store. Posted by Ben Bangert Filed under: Pylons , PythonOctober 19, 2010
WHY EXTENDING THROUGH SUBCLASSING (A FRAMEWORK’S CLASSES) IS A BADIDEA
Ok, I’ll admit it, overly ambitious blog post. So I’ll refine it a little now, this is intended mainly as my thoughts on why as a tool developer (one who makes tools/frameworks that other programmers then use), its a bad idea to implement extensible objects via developer subclassing. This is actually how the web framework I wrote - Pylons - provides its extensibility to developers and lets them change how the framework functions. Please excuse the short and possibly incomplete description, this is mainly a quick post to illustrate a tweet I recently made. FIRST, SOME BACKGROUND… One of the things that Pylons 1.0 and prior is missing is a way to easily extend a Pylons project. While it can be done, its very ad-hoc, kludgy, and generally not very well thought-out. Or thought-out at all really. What was somewhat thought-out was how a developer was supposed to extend and customize the framework. In a Pylons project, the project creates a PylonsApp WSGI object, and all the projects controllers subclass WSGIController. This seemed to work quite well, and indeed many users happily imported PylonsApp, subclassed it to extend/override methods they needed for customization, or changed how their WSGIController subclass worked to change how individual actions would be called. Everything seemed just fine…. until…IMPROVING PYLONS
When I had some free time a little while back, I set about looking into how to extend and improve Pylons to make up for where it was lacking, extensibility. I quickly realized that I’d need to change rather drastically how Pylons dispatch worked, and how controller methods were called to make them more easily extendable. But then with a certain feeling of dread, the subclassing issue nipped me. All my implementations of PylonsApp and WSGIController were EFFECTIVELYFROZEN.
Since every single developer using Pylons sub-classes WSGIController, and to a much lesser extent, PylonsApp, any change to any of the main methods would result in immediate breakage of every single Pylons users app that happened to customize them (the very reason subclassing was used!). This meant that I couldn’t very well change the implementation of the actual classes to fix their design, because that would just cause complete breakage. Ugh! So after looking into it more, I’ve ended up with this short list of the obvious bad reasons this shouldn’t be done. BTW, in Pylons 2, controllers don’t subclass anything, and customization is all with hooks into the framework, no subclassing in sight! SHORT LIST OF WHY IT’S BAD FROM A FRAMEWORK MAINTAINERS POINT OF VIEW… * Implementations of the classes are effectively frozen, because ALL THE CLASS METHODS ARE THE API. * Correcting design flaws or implementation flaws are much more difficult if not impossible without major breakage due to point #1. * Heavily sub-classed/large hierarchy classes can have performancepenalties.
FROM A DEVELOPER ‘EXTENDING’ THE CLASSES POINT OF VIEW… * Figuring out how to unit-test is more difficult as the full implementation is not in your own code… its in the framework code. * When using mix-in’s and other classes that also subclassed the framework, strange conflicts or overrides occur that aren’t at all obvious or easy to debug/troubleshoot. I think there were a few more reasons I came across as well, but I can’t recall them at the moment. In short, I’m now of the rather firm opinion that the only classes you should ever subclass are your OWN classes. Preferably in the same package, or nearby. Posted by Ben Bangert Filed under: Pylons , PythonFebruary 06, 2010
PYLONS 0.10 AND 1.0 BETA 1 RELEASED Without further ado, I’m pleased to announced that Pylons 0.10b1 and 1.0b1 are now out. I have not put them on Cheeseshop to ensure they’re not downloadedaccidentally.
UPGRADING / INSTALLING I have updated upgrading instructions here: http://pylonshq.com/docs/en/1.0/upgrading/ The instructions to install from scratch on Pylons 1.0b1: http://pylonshq.com/docs/en/1.0/gettingstarted/#installing The upgrading page covers the important upgrading instructions that Mike Orr touched briefly on before. Note that these are _beta_ releases, intended for us to discover remaining issues and continue updating any other documentation where applicable. Very little has actually changed in Pylons since 0.9.7, apart from 1.0 dropping all of the legacy functionality and a fewexplicit clean-ups.
UPDATES
Routes, Beaker, and WebHelpers however have been seeing quite a bit of updates through the life of Pylons 0.9.7 so no one should think that the developers working on Pylons and its related parts have been hanging out doing nothing. :) Since Pylons 0.9.7 was released on February 23, 2009, almost one yearago now:
* Routes 1.11 was released, and 1.12 with some great updates will beout shortly
* Beaker has gone from 1.2.2 -> 1.5 with 3 major updates substantially increasing its ease of use and reliability * WebHelpers is now at 1.0b4 with major updates, core functions rewritten, and new docs up * SQLAlchemy has gone from 0.4 to 0.5 (with 0.6 in beta) I believe this speaks a great deal about the benefits of keeping the core Pylons functionality separate from other parts, as a variety of bug fixes and features can be improved without requiring new Pylons releases to quickly address bug reports.HOW TO HELP!
To bring Pylons to 1.0, many docs likely need very small changes. Also, it would be great to take care of reference docs where people have commented about problems/tips. Helping is fairly easy, especially if you’re familiar with restructured text. First: Clone the Pylons repository on Bitbucket: http://bitbucket.org/bbangert/pylons/ Then: Edit the documentation files under pylons/docs/en/ to read as appropriate, commit the fix, and push it to bitbucket. Finally: Issue a pull request on bitbucket so that we’ll know your fix is ready. Ideally you should include a note in it about what yourfix remedies.
BUG REPORTS
Did your upgrade not go according to plan? Was there something missing that you needed to do from the upgrading docs? Let us know by filing a bug report (mark component as documentation, and milestone as 0.10: http://pylonshq.com/project/pylonshq/newticket You’ll need to login to file a bug report, or feel free to reply to this announcement with the issue. Thanks (in alphabetical order) to Mike Bayer, Ian Bicking, Mike Burrows, Graham Higgins, Phil Jenvey, Mike Orr, and anyone else I missed for all their hard work on making Pylons and its various components what they are today. Posted by Ben Bangert Filed under: Pylons , PythonJanuary 07, 2010
DEPLOYING PYTHON WEB APPS WITH TOPPCLOUD Ian Bicking recently released a rather interesting package called toppcloud that aims to tackle what I see as a growing need for those of us deploying Python webapps. I was actually interested in easing my own deployment woes before I saw Ian’s announcement about his package, and was halfway through a rather hefty amount of research on automating server deployments with tools like Chef and Puppet , but toppcloud is a bit different. It not only tackles provisioning a new system on the fly from the ‘cloud’ (using libcloud ), but it also handles _easy Python (and now PHP) web application deployments_. With such a tantalizing set of goals, I couldn’t really resist getting my feet wet. Boy am I glad I did. PylonsHQ is now running with toppcloud, and I won’t be surprised when more people get it running for them. When many shared hosting providers are $5-10 a month, its rather nice to pay $10/mth for an automatically configured VPS, with one-command deployments. Though of course, unless you go to quite a bit of work yourself, most shared hosting providers don’t have one-command deployments for you. Before I continue on to describe how I setup Kai - the source code behind PylonsHQ - I should provide a few caveats about using toppcloud: * toppcloud is ALPHA SOFTWARE, there’s no releases of it yet, you will be checking it out from source code * currently, only Rackspace Cloud is known to be working, though since it uses libcloud, _in theory_, any cloud providers that it supports should be usable * toppcloud is changing rapidly, be ready to keep up on the commit log to see whats changing * there are NO UNIT TESTS, most likely because its very tedious to make the rather significant amount of mock objects required to test the various local/remote commands and the fact that its changing so fast the tests would probably be obsolete in a week TOPPCLOUD PHILOSOPHY I’m half guessing here, based on talking with Ian and reading the docs myself, but the philosophy of toppcloud is around providing a common deployment platform, ala Google App Engine, except of course with Postgres or other ‘services’ that you can request to use. At the moment the only services that toppcloud comes with is CouchDB, Files (to store/serve files for your app on the filesystem), and Postgres w/postgis extensions. For those diving into the source code, it shouldn’t be too hard to see how to create additional services and I hope to see more get added as people get more interested. Therefore, toppcloud is not expected to be everything to everyone, it is expected to be at least an 80+% solution to deploying web apps in a Google App Engine style ease-of-deployment process. toppcloud itself then ensures that depending on what service you asked for, its setup and ready for use on the server when your app is deployed. If that sounds like something you’re dying to try out, you’re inluck!
SETTING UP A PYLONS APP I’m not going to mention how to check out the toppcloud source, except to mention the directions are in the/docs/index.txt
file in the toppcloud source (which should be read in its entirety!). Once you have toppcloud installed on your computer, getting from zero to running website on VPS is remarkably quick:*
$ toppcloud create-node --image-id=14362 baseimage Wait until email arrived indicating that server is up and ready*
$ toppcloud setup-node baseimage Server is now all setup to run web apps!*
$ toppcloud init myapp Create an app to deploy to our server*
$ source myapp/bin/activate Activate the virtualenv used for this app*
$ pip install Pylons*
$ cd myapp/src
*
$ paster create -t pylons awesomeapp Create our Pylons app, or check out an existing one from your VCS here*
$ cd ../..
*
$ ln -s myapp/src/awesomeapp/awesomeapp/public/ myapp/static toppcloud will make available things in the static directory available without hitting the webapp*
Configure myapp/app.ini similarly to (taken from pylonshq site): app_name = pylonshq runner = src/kai/production.iniversion = 1
update_fetch = /sync_appservice.couchdb =
service.files =
default_host = pylonshq.com In this case, the Pylons site needs CouchDB setup, and the files service (all Pylons sites should use the files service to store cached files, templates, etc.)*
$ toppcloud update myapp/ Note that we’re one directory above myapp, and we have a trailing slash on myapp, this is needed because an rsync is done to copy it to the server, don’t leave off the trailing slash! (This will prolly be fixed at some point) That’s it! 10 easy steps to go from zero to a running DEPLOYEDwebsite.
I should also note that you will need to make a production.ini file, and that it should have a few important changes in it. All the references to %(here)s should be changed to %(CONFIG_FILES)s since that’s the persistent location that files can be stored for a toppcloud app between deployments. Other configuration information provided by services (Couch supplies the db/host, Postgres has its host/user/pass info) can be accessed via CONFIG_ vars as well. Theservices docs
have
some more info.
More apps can be added to a host as desired, until the ram runs out of course. At the moment toppcloud is using a process pool of 5 with 1 thread under mod-wsgi for each application. This can use a bit of ram if you have multiple heavy Pylons processes, hopefully there will shortly be a way to ask toppcloud to use a single process with multiple threads which will help cut the ram profile a bit. USING DJANGO AND PHP Unfortunately I haven’t actually tried this myself, but there’s nothing preventing it. You’ll need to change the app.ini so that instead of using ‘src/kai/production.ini’ as the runner, it uses a Python file in the directory, say main.py that then loads the Django app as a WSGI application and returns it. Sort of like this.
Note that the config vars Django needs for its database should then be present in os.environ when setting up the settings.py that Djangouses.
If you’re looking through the toppcloud source code by now, you may have also noticed there’s an example app that uses PHP. There’s nothing holding back toppcloud from setting up mod_passenger and deploying Ruby apps at some point either should someone wish to addthat feature.
DUMB PIPES
There’s been numerous mentions on various blogs and in the news about how much the cell phone carriers hate the concept of being nothing more than “dumb pipes” for wireless Internet and phone use. That means of course, that they’d no longer be competing on what phones you could use but instead _solely on service quality and price_… I think the same type of transition is in store for shared hosting providers and some of the boutique app deployment shops likeheroku .
It’ll take awhile, toppcloud is very rough right now. But when you can d/l a nice little open-source package, run it, choose your choice of cloud provider (based on price + quality!), have it automatically setup for you to deploy your apps to, then deploy apps with a single command… you’ve already done the vast majority of what a service like heroku does, except you could still modify toppcloud if there was something lacking you really needed. And it’s a reason like that, that toppcloud exists to begin with. Oh, and thanks Ian for writing this before I wasted more time makingit myself.
Posted by Ben Bangert Filed under: Pylons , Python* Older »
— Blog Archive — Copyright 2019, Ben Bangert. Powered by Tinkererand Sphinx .
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0