Skip to content

Instantly share code, notes, and snippets.

View mallow111's full-sized avatar

Min Wang mallow111

View GitHub Profile
@mallow111
mallow111 / main.go
Created June 22, 2017 22:14 — forked from superbrothers/main.go
http request with context in Go
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)

Keybase proof

I hereby claim:

  • I am mallow111 on github.
  • I am mallow123 (https://keybase.io/mallow123) on keybase.
  • I have a public key ASBYO-YvRFDBSs6SViTzkWrFH4RsuRrceJUFUOpnIleq5wo

To claim this, I am signing this object:

#!/bin/bash
# Set up the packages we need
apt-get update
apt-get install git vim -y
# Clone the devstack repo
git clone https://github.com/openstack-dev/devstack.git /tmp/devstack
cat <<EOF > /tmp/devstack/localrc
@mallow111
mallow111 / gist:0d86a49c9b8c7cfcb5b0
Last active August 29, 2015 14:26
How to setup upstream gate for octavia
https://wiki.openstack.org/wiki/Neutron/FunctionalGateSetup
By defualt Neutron LbaaS runs against haproxy, but we want to know if we install octavia plugin, is that possible for Neutron LBaaS to pass tempest test, that is the goal of this task.
Octavia is just the backend same as haproxy, so we dont need to setup new job for it, but we need to set in the section of Neutron-lbaas in project.yaml to make it pass octavia gate, also need to mark the expriemental gate in layout.yaml, the details are listed in the below:
step 0: add octavia in PROJECT env list otherwise, octavia plugin is not able to git cloned in the following step, this file is located in devstack-gate/devstack-vm-gate-wrap.sh
step1: setup Jenkins/jobs/projects.yaml:
under the section add octavia gate:
- project:
@mallow111
mallow111 / gist:e4d6ae23beee426ec9b3
Last active August 29, 2015 14:25
tempest test result for Neutron lbaas v2 against octavia plugin
passed files or skipped files(under neutron_lbaas/v2/api):
test_load_balancers_admin.py
test_load_balancer_non_admin.py
test_listener.py
test_pools_admin.py
Failed files :
1. test_health_monitor_admin.py under v2/api folder, failed reason :
#Create LB
http://localhost:9876/v1/loadbalancers
{
"name": "loadbalancer1",
"description": "simple lb",
"vip": {"subnet_id": "ac7d27ae-7ace-459f-ae11-a4568abd227a"}
}
#Create LIstener
http://localhost:9876/v1/loadbalancers/0c59f9c3-13e2-47ad-bf7e-fd533c51e918/listeners
to check the config of git : go to .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
@mallow111
mallow111 / gist:11dda3a722565651ba74
Last active August 29, 2015 14:24
give up tempest test for healthmonitor, instead use scenario test
i found one thing which i am not sure
[12:10] <mwang2> so when i create health monitor, no matter its admin_state_up flag is true or false, its provisioing status is always active, is this by perpose?
[12:11] <blogan> well provisioning status shouldn't reflect any changes in admin_state_up
[12:11] <blogan> just operating status if there is on
[12:11] <blogan> one
[12:12] <mwang2> for healthmonitor,it does not have
[12:17] <mwang2> this affect the admin state up test for health monitor, since health monitor does not have operating status, how can we test this flag then
[12:17] <mwang2> https://review.openstack.org/#/c/191217/7/neutron_lbaas/tests/tempest/v2/api/base.py
[12:18] <blogan> a functional test would have to be used then, one that ensured that if that gets set to False then the members of the pool come back into rotation
[12:18] <blogan> well pool members that were pulled otu of rotation
minwang1@ubuntu:~/devstack$ /usr/local/bin/octavia-api --config-file /etc/octavia/octavia.conf & echo $! >/opt/stack/status/stack/o-api.pid; fg || echo "o-api failed to start" | tee "/opt/stack/status/stack/o-api.failure"
[1] 89578
/usr/local/bin/octavia-api --config-file /etc/octavia/octavia.conf
2015-07-07 15:49:20.844 89578 INFO octavia.common.config [-] Logging enabled!
2015-07-07 15:49:21.183 89578 INFO octavia.cmd.api [-] Starting API server on 0.0.0.0:9876
2015-07-07 15:50:25.671 89578 DEBUG oslo_db.sqlalchemy.engines [req-65fe194a-f653-44ff-9238-16676be5eb4f - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py:253
2015-07-07 15:50:25.723 89578 INFO octavia.api.v1.controllers.load_balancer [req-65fe194a-f653-44ff-9238-16676be5eb4f - - - - -] Sending created Load Balancer 7547981
@mallow111
mallow111 / gist:486cbc01268df727cf46
Last active August 29, 2015 14:24
error message for o-cw
2015-07-07 16:12:34.475 98003 WARNING octavia.controller.worker.controller_worker [-] Task 'octavia.controller.worker.tasks.compute_tasks.ComputeWait' (5fc81d5d-3ce2-460b-967c-a3108961179a) transitioned into state 'FAILURE' from state 'RUNNING'
2015-07-07 16:12:34.475 98003 ERROR octavia.controller.worker.controller_worker Traceback (most recent call last):
2015-07-07 16:12:34.475 98003 ERROR octavia.controller.worker.controller_worker File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 68, in _execute_task
2015-07-07 16:12:34.475 98003 ERROR octavia.controller.worker.controller_worker result = task.execute(**arguments)
2015-07-07 16:12:34.475 98003 ERROR octavia.controller.worker.controller_worker File "/opt/stack/octavia/octavia/controller/worker/tasks/compute_tasks.py", line 155, in execute
2015-07-07 16:12:34.475 98003 ERROR octavia.controller.worker.controller_worker raise exceptions.ComputeWaitTimeoutException()
2015-07-07 16:12:34.475 98003 ERROR o