Skip to content

Commit 8e0bf3f

Browse files
author
scrungus
committed
Revert "Merge pull request #125 from scrungus/stackhpc/yoga"
This reverts commit add8105, reversing changes made to d92a110.
1 parent ce67736 commit 8e0bf3f

File tree

24 files changed

+20
-4049
lines changed

24 files changed

+20
-4049
lines changed

devstack/contrib/new-devstack.sh

Lines changed: 0 additions & 119 deletions
This file was deleted.

devstack/lib/magnum

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -311,22 +311,11 @@ function magnum_register_image {
311311
echo "Unknown image extension in $image_filename, supported extensions: tgz, img, qcow2, iso, vhd, vhdx, tar.gz, img.gz, img.bz2, vhd.gz, vhdx.gz, qcow2.xz"; false
312312
fi
313313

314-
# Cluster API driver sets kube_version on the image
315-
# as the image includes the k8s binaries
316-
if [ ! -z "$MAGNUM_IMAGE_KUBE_VERSION" ]; then
317-
magnum_image_property=$magnum_image_property" --property kube_version=$MAGNUM_IMAGE_KUBE_VERSION"
318-
fi
319-
320314
openstack image set $image_name $magnum_image_property
321-
openstack image set --public $image_name
322-
openstack image show -f yaml $image_name
323315
}
324316

325317
#magnum_configure_flavor - set hw_rng property for flavor to address the potential entropy issue
326318
function magnum_configure_flavor {
327-
# add a new flavor with two vcpus and just enough RAM
328-
openstack flavor create ds2G20 --ram 2048 --disk 20 --id d5 --vcpus 2 --public
329-
330319
local magnum_flavor_property="--property hw_rng:allowed=True --property hw_rng:rate_bytes=1024 --property hw_rng:rate_period=1"
331320

332321
local FLAVOR_LIST=$(openstack flavor list -c Name -f value)
@@ -344,122 +333,12 @@ function install_magnumclient {
344333
fi
345334
}
346335

347-
function setup_capi_management_cluster {
348-
349-
# # Install `kubectl` CLI
350-
curl -fsLo /tmp/kubectl "https://dl.k8s.io/release/$(curl -fsL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
351-
sudo install -o root -g root -m 0755 /tmp/kubectl /usr/local/bin/kubectl
352-
353-
# K3s has issues without apparmor, so we add it here
354-
sudo apt install -y apparmor apparmor-utils
355-
356-
# Install k3s
357-
curl -fsL https://get.k3s.io | sudo bash -s - --disable traefik
358-
359-
# copy kubeconfig file into standard location
360-
mkdir -p $HOME/.kube
361-
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
362-
sudo chown $USER $HOME/.kube/config
363-
364-
# Install helm
365-
curl -fsL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
366-
367-
{
368-
# Install cert manager
369-
helm upgrade cert-manager cert-manager \
370-
--install \
371-
--namespace cert-manager \
372-
--create-namespace \
373-
--repo https://charts.jetstack.io \
374-
--version v1.10.1 \
375-
--set installCRDs=true \
376-
--wait \
377-
--timeout 10m
378-
} || {
379-
kubectl -n cert-manager get pods | awk '$1 && $1!="NAME" { print $1 }' | xargs -n1 kubectl -n cert-manager logs
380-
exit
381-
}
382-
383-
# Install Cluster API resources
384-
mkdir -p capi
385-
cat <<EOF > capi/kustomization.yaml
386-
---
387-
resources:
388-
- >-
389-
https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.2/cluster-api-components.yaml
390-
- >-
391-
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/v0.7.2/infrastructure-components.yaml
392-
patches:
393-
- patch: |-
394-
- op: replace
395-
path: /spec/template/spec/containers/0/args
396-
value:
397-
- --leader-elect
398-
- --metrics-bind-addr=localhost:8080
399-
target:
400-
kind: Deployment
401-
namespace: capi-system
402-
name: capi-controller-manager
403-
- patch: |-
404-
- op: replace
405-
path: /spec/template/spec/containers/0/args
406-
value:
407-
- --leader-elect
408-
- --metrics-bind-addr=localhost:8080
409-
target:
410-
kind: Deployment
411-
namespace: capi-kubeadm-bootstrap-system
412-
name: capi-kubeadm-bootstrap-controller-manager
413-
- patch: |-
414-
- op: replace
415-
path: /spec/template/spec/containers/0/args
416-
value:
417-
- --leader-elect
418-
- --metrics-bind-addr=localhost:8080
419-
target:
420-
kind: Deployment
421-
namespace: capi-kubeadm-control-plane-system
422-
name: capi-kubeadm-control-plane-controller-manager
423-
EOF
424-
425-
kubectl apply -k capi
426-
427-
kubectl rollout status deployment/capi-controller-manager \
428-
--namespace capi-system \
429-
--timeout 5m \
430-
&& \
431-
kubectl rollout status deployment/capi-kubeadm-bootstrap-controller-manager \
432-
--namespace capi-kubeadm-bootstrap-system \
433-
--timeout 5m \
434-
&& \
435-
kubectl rollout status deployment/capi-kubeadm-control-plane-controller-manager \
436-
--namespace capi-kubeadm-control-plane-system \
437-
--timeout 5m \
438-
&& \
439-
kubectl rollout status deployment/capo-controller-manager \
440-
--namespace capo-system \
441-
--timeout 10m
442-
443-
# Install addon manager
444-
helm upgrade cluster-api-addon-provider cluster-api-addon-provider \
445-
--install \
446-
--repo https://stackhpc.github.io/cluster-api-addon-provider \
447-
--version 0.1.0-dev.0.main.26 \
448-
--namespace capi-addon-system \
449-
--create-namespace \
450-
--wait \
451-
--timeout 10m
452-
}
453-
454336
# install_magnum() - Collect source and prepare
455337
function install_magnum {
456338
install_apache_uwsgi
457339

458340
git_clone $MAGNUM_REPO $MAGNUM_DIR $MAGNUM_BRANCH
459341
setup_develop $MAGNUM_DIR
460-
461-
# get ready for capi driver
462-
setup_capi_management_cluster
463342
}
464343

465344
# start_magnum_api() - Start the API process ahead of other things

magnum/common/clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from barbicanclient import client as barbicanclient
15+
from barbicanclient.v1 import client as barbicanclient
1616
from cinderclient.v3 import client as cinder_client
1717
from glanceclient import client as glanceclient
1818
from heatclient import client as heatclient

magnum/common/exception.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,6 @@ class OSDistroFieldNotFound(ResourceNotFound):
301301
code = 400
302302

303303

304-
class KubeVersionPropertyNotFound(Invalid):
305-
message = _("Image %(image_id)s does not have a kube_version property.")
306-
307-
308304
class X509KeyPairNotFound(ResourceNotFound):
309305
message = _("A key pair %(x509keypair)s could not be found.")
310306

magnum/common/urlfetch.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def get(url, allowed_schemes=('http', 'https')):
3434
"""Get the data at the specified URL.
3535
3636
The URL must use the http: or https: schemes.
37+
The file: scheme is also supported if you override
38+
the allowed_schemes argument.
3739
Raise an IOError if getting the data fails.
3840
"""
3941
LOG.info('Fetching data from %s', url)
@@ -43,8 +45,14 @@ def get(url, allowed_schemes=('http', 'https')):
4345
if components.scheme not in allowed_schemes:
4446
raise URLFetchError(_('Invalid URL scheme %s') % components.scheme)
4547

48+
if components.scheme == 'file': # nosec
49+
try:
50+
return urllib.request.urlopen(url).read()
51+
except urllib.error.URLError as uex:
52+
raise URLFetchError(_('Failed to retrieve manifest: %s') % uex)
53+
4654
try:
47-
resp = requests.get(url, stream=True, timeout=60)
55+
resp = requests.get(url, stream=True)
4856
resp.raise_for_status()
4957

5058
# We cannot use resp.text here because it would download the

magnum/conf/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from magnum.conf import api
1919
from magnum.conf import barbican
20-
from magnum.conf import capi_driver
2120
from magnum.conf import certificates
2221
from magnum.conf import cinder
2322
from magnum.conf import cluster
@@ -49,7 +48,6 @@
4948

5049
api.register_opts(CONF)
5150
barbican.register_opts(CONF)
52-
capi_driver.register_opts(CONF)
5351
cluster.register_opts(CONF)
5452
cluster_templates.register_opts(CONF)
5553
cluster_heat.register_opts(CONF)

0 commit comments

Comments
 (0)