Skip to content

Commit

Permalink
Dev (#50)
Browse files Browse the repository at this point in the history
*  Minor text updates to indicate that there is only a single instance of the ubiquity service running in a deployment

Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com>
  • Loading branch information
midoblgsm committed Jun 19, 2017
1 parent da09196 commit fbe5cb9
Show file tree
Hide file tree
Showing 16 changed files with 2,676 additions and 294 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ The Ubiquity service can be run on one or more nodes in the cluster to create, m
This code is provided "AS IS" and without warranty of any kind. Any issues will be handled on a best effort basis.

## Sample Deployment Options
The service can be deployed in a variety of ways. In all options though, Ubiquity must be
deployed on a system that has access (e.g., CLI, REST, ssh) to the supported storage system. We use the IBM SpectrumScale file system as an example.
The service can be deployed in a variety of ways. In all options,
- Ubiquity must be deployed on a system that has access (e.g., CLI, REST, ssh) to the supported storage system
- There is a single instance of the Ubiquity service deployed across the entire cluster. All volume plugins on the docker or Kubernetes hosts will access this single Ubiquity service for volume management.

We use the IBM Spectrum Scale file system as an example storage system.

#### Single Node (All in One)
![Single node](images/singleNode.jpg)
Expand Down
35 changes: 0 additions & 35 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">



<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-81a59bf26d881d29286674f6deefe779c444382fff322085b50ba455460ccae5.css" integrity="sha256-gaWb8m2IHSkoZnT23u/necREOC//MiCFtQukVUYMyuU=" media="all" rel="stylesheet" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-f09eadfa6bc10db3f2203de09e1e4850ee95a6e8c2b8ec976dc71f94d21ab73e.css" integrity="sha256-8J6t+mvBDbPyID3gnh5IUO6VpujCuOyXbccflNIatz4=" media="all" rel="stylesheet" />





<meta name="viewport" content="width=device-width">

<title>Choose a theme</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
Expand Down Expand Up @@ -44,7 +33,6 @@
<meta name="pjax-timeout" content="1000">
<link rel="sudo-modal" href="/sessions/sudo_modal">
<meta name="request-id" content="053D:21B3B:DFCF14D:14E993D4:5919BEB2" data-pjax-transient>


<meta name="selected-link" value="/IBM/ubiquity/settings/pages/themes" data-pjax-transient>

Expand All @@ -61,7 +49,6 @@
<meta class="js-ga-set" name="dimension1" content="Logged In">




<meta name="hostname" content="github.com">
<meta name="user-login" content="midoblgsm">
Expand All @@ -73,7 +60,6 @@
<meta name="html-safe-nonce" content="f21c5a2e62beefe6084aa63c3504c84cd0766f6d">

<meta http-equiv="x-pjax-version" content="7cfbda8fe42e09c7a7c8e761b6b60459">


<meta name="description" content="GitHub is where people build software. More than 21 million people use GitHub to discover, fork, and contribute to over 58 million projects.">

Expand All @@ -93,21 +79,13 @@
</head>

<body class="logged-in env-production emoji-size-boost">




<div class="position-relative js-header-wrapper ">
<a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
<div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div>








<div class="header" role="banner">
<div class="container clearfix">
<a class="header-logo-invertocat" href="https://github.com/" data-hotkey="g d" aria-label="Homepage" data-ga-click="Header, go to dashboard, icon:logo">
Expand Down Expand Up @@ -148,10 +126,8 @@
</li>
</ul>


<ul class="header-nav user-nav float-right" id="user-links">
<li class="header-nav-item">

<a href="/notifications" aria-label="You have unread notifications" class="header-nav-link notification-indicator tooltipped tooltipped-s js-socket-channel js-notification-indicator " data-channel="notification-changed:11037155" data-ga-click="Header, go to notifications, icon:unread" data-hotkey="g n">
<span class="mail-status unread"></span>
<svg aria-hidden="true" class="octicon octicon-bell float-left" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 12v1H0v-1l.73-.58c.77-.77.81-2.55 1.19-4.42C2.69 3.23 6 2 6 2c0-.55.45-1 1-1s1 .45 1 1c0 0 3.39 1.23 4.16 5 .38 1.88.42 3.66 1.19 4.42l.66.58H14zm-7 4c1.11 0 2-.89 2-2H5c0 1.11.89 2 2 2z"/></svg>
Expand All @@ -168,7 +144,6 @@

<div class="dropdown-menu-content js-menu-content">
<ul class="dropdown-menu dropdown-menu-sw">

<a class="dropdown-item" href="/new" data-ga-click="Header, create new repository">
New repository
</a>
Expand Down Expand Up @@ -255,8 +230,6 @@
</div>




</div>

<div id="start-of-content" class="accessibility-aid"></div>
Expand Down Expand Up @@ -396,9 +369,6 @@
</div>





<div id="ajax-error-message" class="ajax-error-message flash flash-error">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
Expand All @@ -408,13 +378,8 @@
</div>



<script crossorigin="anonymous" integrity="sha256-TSHUqkLMGrDTV62bO5xrjH19eiSNmJ+qVseXiPwsH4g=" src="https://assets-cdn.github.com/assets/frameworks-4d21d4aa42cc1ab0d357ad9b3b9c6b8c7d7d7a248d989faa56c79788fc2c1f88.js"></script>
<script async="async" crossorigin="anonymous" integrity="sha256-OH5EAFeGNQKQH4/GXzCrTYhQ1gSBFm2kxdGYPp6KT+s=" src="https://assets-cdn.github.com/assets/github-387e440057863502901f8fc65f30ab4d8850d60481166da4c5d1983e9e8a4feb.js"></script>




<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
Expand Down
6 changes: 1 addition & 5 deletions fakes/fake_SpectrumDataModel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 125 additions & 5 deletions fakes/fake_spectrum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions local/spectrumscale/connectors/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type SpectrumScaleConnector interface {
//TODO modify quota from string to Capacity (see kubernetes)
ListFilesetQuota(filesystemName string, filesetName string) (string, error)
SetFilesetQuota(filesystemName string, filesetName string, quota string) error
ExportNfs(volumeMountpoint string, clientConfig string) error
UnexportNfs(volumeMountpoint string) error
}

const (
Expand All @@ -35,8 +37,8 @@ const (

func GetSpectrumScaleConnector(logger *log.Logger, config resources.SpectrumScaleConfig) (SpectrumScaleConnector, error) {
if config.RestConfig.Endpoint != "" {
logger.Printf("Initializing SpectrumScale REST connector with restConfig: %+v\n", config.RestConfig)
return NewSpectrumRest(logger, config.RestConfig)
logger.Printf("Initializing SpectrumScale REST connector\n")
return NewSpectrumRestV2(logger, config.RestConfig)
}
if config.SshConfig.User != "" && config.SshConfig.Host != "" {
if config.SshConfig.Port == "" || config.SshConfig.Port == "0" {
Expand Down
24 changes: 24 additions & 0 deletions local/spectrumscale/connectors/connectors_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package connectors_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"testing"

"github.com/jarcoal/httpmock"
)

func TestConnectors(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Connectors Suite")
}

var _ = BeforeSuite(func() {
// block all HTTP requests
httpmock.Activate()
})

var _ = AfterSuite(func() {
httpmock.DeactivateAndReset()
})
46 changes: 46 additions & 0 deletions local/spectrumscale/connectors/mmcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,49 @@ func SetFilesetQuotaInternal(logger *log.Logger, executor utils.Executor, filesy
logger.Printf("setFilesetQuota output: %s\n", string(output))
return nil
}

func (s *spectrum_mmcli) ExportNfs(volumeMountpoint string, clientConfig string) error {
s.logger.Println("spectrumLocalClient: ExportNfs start")
defer s.logger.Println("spectrumLocalClient: ExportNfs end")

spectrumCommand := "/usr/lpp/mmfs/bin/mmnfs"
args := []string{spectrumCommand, "export", "add", volumeMountpoint, "--client", clientConfig}

return ExportNfsInternal(s.logger, s.executor, "sudo", args)
}

func ExportNfsInternal(logger *log.Logger, executor utils.Executor, command string, args []string) error {

output, err := executor.Execute(command, args)

if err != nil {
logger.Printf("Failed to export fileset via Nfs: error %#v ExportNfs output: %#v\n", err, output)
return fmt.Errorf("Failed to export fileset via Nfs: %s", err.Error())
}

logger.Printf("ExportNfs output: %s\n", string(output))
return nil
}

func (s *spectrum_mmcli) UnexportNfs(volumeMountpoint string) error {
s.logger.Println("spectrumLocalClient: UnexportNfs start")
defer s.logger.Println("spectrumLocalClient: UnexportNfs end")

spectrumCommand := "/usr/lpp/mmfs/bin/mmnfs"
args := []string{spectrumCommand, "export", "remove", volumeMountpoint, "--force"}

return UnexportNfsInternal(s.logger, s.executor, "sudo", args)
}

func UnexportNfsInternal(logger *log.Logger, executor utils.Executor, command string, args []string) error {

output, err := executor.Execute(command, args)

if err != nil {
logger.Printf("Failed to unexport fileset via Nfs: error %#v UnexportNfs output: %#v \n", err, output)
return fmt.Errorf("Failed to unexport fileset via Nfs: %s", err.Error())
}

logger.Printf("UnexportNfs output: %s\n", string(output))
return nil
}
Loading

0 comments on commit fbe5cb9

Please sign in to comment.