fog-hadoop 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d6cf0fbcd7d3d76be2f843557741cfa219ce415f
4
+ data.tar.gz: b2562198c3186f9f4e8180163af038ac01c96cd1
5
+ SHA512:
6
+ metadata.gz: e46ebef80dc8833b7497ca0a73125a692c802989f6dd9210d1038c37a7c5212325d6a56c92520cd582b17ae1d8f9f0a7e819eabc7ac45d9c4ce5f3c727995939
7
+ data.tar.gz: 110329ecf4257de26a988fea03469865412d621fc1a227a0b9d5be3f38f5d3eb5c6e522cad3e20556b49bd783c939784b47914dbaa7aca107df0eb3ff9ef27a9
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ gemfiles/Gemfile-1.9.lock
11
+ .DS_Store
12
+ .idea/
@@ -0,0 +1,38 @@
1
+ # Custom Enforced Rubocop Styles
2
+
3
+ LineLength:
4
+ Enabled: false
5
+ MethodLength:
6
+ Enabled: false
7
+ ClassLength:
8
+ Enabled: false
9
+ SignalException:
10
+ Enabled: false
11
+ RaiseArgs:
12
+ Enabled: false
13
+ ParameterLists:
14
+ Enabled: false
15
+ AbcSize:
16
+ Enabled: false
17
+ RedundantBegin:
18
+ Enabled: false
19
+ PerceivedComplexity:
20
+ Enabled: false
21
+ CyclomaticComplexity:
22
+ Enabled: false
23
+ RescueException:
24
+ Enabled: false
25
+ NestedParenthesizedCalls:
26
+ Enabled: false
27
+
28
+ # Custom Enforced Hound Ruby Styles
29
+
30
+ CollectionMethods:
31
+ PreferredMethods:
32
+ detect: find
33
+ StringLiterals:
34
+ EnforcedStyle: single_quotes
35
+ SignalException:
36
+ EnforcedStyle: only_raise
37
+ Style/FrozenStringLiteralComment:
38
+ Enabled: false
@@ -0,0 +1 @@
1
+ fog-hadoop
@@ -0,0 +1 @@
1
+ 2.3.1
@@ -0,0 +1,8 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ script:
6
+ - bundle install
7
+ - bundle exec rake travis
8
+ after_script: bundle exec codeclimate-test-reporter
@@ -0,0 +1,40 @@
1
+ ## Getting Involved
2
+
3
+ New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
4
+
5
+ For structure information of fog click [here](https://github.com/fog/fog-hadoop/blob/master/lib/fog/hadoop/docs/structure.md)
6
+
7
+ ### Coding
8
+
9
+ * Pick a task:
10
+ * Offer feedback on open [pull requests](https://github.com/fog/fog-hadoop/pulls).
11
+ * Review open [issues](https://github.com/fog/fog-hadoop/issues) for things to help on.
12
+ * [Create an issue](https://github.com/fog/fog-hadoop/issues/new) to start a discussion on additions or features.
13
+ * Fork the project, add your changes and tests to cover them in a topic branch.
14
+ * [Fork](https://github.com/fog/fog-hadoop/fork)
15
+ * Create your feature branch (`git checkout -b my-new-feature`)
16
+ * Commit your changes (`git commit -am 'Add some feature'`)
17
+ * Push to the branch (`git push origin my-new-feature`)
18
+ * Create a new pull request
19
+ * Commit your changes and rebase against `fog/fog-azure-rm` to ensure everything is up to date.
20
+ * [Submit a pull request](https://github.com/fog/fog-hadoop/compare/).
21
+
22
+ ### Non-Coding
23
+
24
+ * Offer feedback on open [issues](https://github.com/fog/fog-hadoop/issues).
25
+ * Organize or volunteer at events.
26
+ * Write and help edit [documentation](https://github.com/fog/fog-hadoop/tree/master/lib/fog/aljesusg/docs).
27
+
28
+ ## Testing
29
+ You can run `Minitest` tests by running this command in the root directory.
30
+
31
+ ```shell
32
+ $ rake test
33
+ ```
34
+
35
+ ## Code Coverage
36
+ We are using Simplecov Gem for code coverage. You can see the report of Code Coverage by running this command in the root directory.
37
+
38
+ ```shell
39
+ $ rake coverage
40
+ ```
@@ -0,0 +1 @@
1
+ * Alberto Gutiérrez <aljesusg@gmail.com>
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ # Specify your gem's dependencies in fog-azure-rm.gemspec
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Alberto Jesus Gutierrez Juanes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # fog-hadoop
2
+ [![Build Status](https://travis-ci.org/fog/fog-hadoop.svg?branch=master)](https://travis-ci.org/fog/fog-hadoop) [![Code Climate](https://lima.codeclimate.com/github/fog/fog-hadoop/badges/gpa.svg)](https://lima.codeclimate.com/github/fog/fog-hadoop) [![Test Coverage](https://lima.codeclimate.com/github/fog/fog-hadoop/badges/coverage.svg)](https://lima.codeclimate.com/github/fog/fog-hadoop/coverage)
3
+
4
+ ## Fog connector for Hadoop
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'fog-hadoop'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install fog-hadoop
21
+ ## Usage
22
+
23
+ ### Initial Setup
24
+
25
+ Require the gem:
26
+
27
+ ```ruby
28
+ require "fog/hadoop"
29
+ ```
30
+
31
+
32
+ Connection parameters:
33
+
34
+ ```ruby
35
+ @connection_params = {
36
+ hadoop_compute_api_url: "http://<resource_manager_host>:8088/"
37
+ }
38
+ ```
39
+
40
+ * Use [Yarn](docs/yarn.md)
41
+
42
+ # Support
43
+
44
+ Check in this [link](supported.md)
45
+
46
+ # Contribute
47
+ Read the [contribute](docs/CONTRIBUTING.md) documentation
48
+
49
+ # Development
50
+
51
+ You can use this [Vagrant Hadoop](https://github.com/vangj/vagrant-hadoop-2.4.1-spark-1.0.1) repo to have a environment to dev.
@@ -0,0 +1,112 @@
1
+ require 'bundler/setup'
2
+ require "bundler/gem_tasks"
3
+ require 'rake/testtask'
4
+ require 'date'
5
+ require 'rubygems'
6
+ require 'rubygems/package_task'
7
+ require 'yard'
8
+ require File.dirname(__FILE__) + '/lib/fog/hadoop'
9
+
10
+ #############################################################################
11
+ #
12
+ # Helper functions
13
+ #
14
+ #############################################################################
15
+
16
+ def name
17
+ @name ||= Dir['*.gemspec'].first.split('.').first
18
+ end
19
+
20
+ def version
21
+ Fog::VERSION
22
+ end
23
+
24
+ def date
25
+ Date.today.to_s
26
+ end
27
+
28
+ def rubyforge_project
29
+ name
30
+ end
31
+
32
+ def gemspec_file
33
+ "#{name}.gemspec"
34
+ end
35
+
36
+ def gem_file
37
+ "#{name}-#{version}.gem"
38
+ end
39
+
40
+ def replace_header(head, header_name)
41
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
42
+ end
43
+
44
+ #############################################################################
45
+ #
46
+ # Standard tasks
47
+ #
48
+ #############################################################################
49
+
50
+ GEM_NAME = "#{name}"
51
+ task :default => :test
52
+ task :travis => ['test', 'test:travis']
53
+
54
+ Rake::TestTask.new do |t|
55
+ t.pattern = File.join("spec", "**", "*_spec.rb")
56
+ end
57
+
58
+ namespace :test do
59
+ mock = ENV['FOG_MOCK'] || 'true'
60
+ task :travis do
61
+ sh("export FOG_MOCK=#{mock} && bundle exec shindont")
62
+ end
63
+ task :vsphere do
64
+ sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
65
+ end
66
+ task :openvz do
67
+ sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/openvz")
68
+ end
69
+ end
70
+
71
+ desc 'Run mocked tests for a specific provider'
72
+ task :mock, :provider do |t, args|
73
+ if args.to_a.size != 1
74
+ fail 'USAGE: rake mock[<provider>]'
75
+ end
76
+ provider = args[:provider]
77
+ sh("export FOG_MOCK=true && bundle exec shindont tests/#{provider}")
78
+ end
79
+
80
+ desc 'Run live tests against a specific provider'
81
+ task :live, :provider do |t, args|
82
+ if args.to_a.size != 1
83
+ fail 'USAGE: rake live[<provider>]'
84
+ end
85
+ provider = args[:provider]
86
+ sh("export FOG_MOCK=false PROVIDER=#{provider} && bundle exec shindont tests/#{provider}")
87
+ end
88
+
89
+ task :nuke do
90
+ Fog.providers.each do |provider|
91
+ next if ['Vmfusion'].include?(provider)
92
+ begin
93
+ compute = Fog::Compute.new(:provider => provider)
94
+ for server in compute.servers
95
+ Fog::Formatador.display_line("[#{provider}] destroying server #{server.identity}")
96
+ server.destroy rescue nil
97
+ end
98
+ rescue
99
+ end
100
+ begin
101
+ dns = Fog::DNS.new(:provider => provider)
102
+ for zone in dns.zones
103
+ for record in zone.records
104
+ record.destroy rescue nil
105
+ end
106
+ Fog::Formatador.display_line("[#{provider}] destroying zone #{zone.identity}")
107
+ zone.destroy rescue nil
108
+ end
109
+ rescue
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fog/hadoop"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,91 @@
1
+ #Yarn use samples
2
+
3
+ ```ruby
4
+ @connection_params = {
5
+ hadoop_compute_api_url: "http://<resource_manager_host>:8088/"
6
+ }
7
+ ```
8
+
9
+ ## Get Metrics
10
+
11
+ ```
12
+ compute = Fog::Compute::Hadoop.new(@connection_params)
13
+ compute.get_metrics
14
+ ```
15
+
16
+ ```
17
+ # => {"appsSubmit`ted"=>0,
18
+ # "appsCompleted"=>0,
19
+ # "appsPending"=>0,
20
+ # "appsRunning"=>0,
21
+ # "appsFailed"=>0,
22
+ # "appsKilled"=>0,
23
+ # "reservedMB"=>0,
24
+ # "availableMB"=>16384,
25
+ # "allocatedMB"=>0,
26
+ # "containersAllocated"=>0,
27
+ # "containersReserved"=>0,
28
+ # "containersPending"=>0,
29
+ # "totalMB"=>16384,
30
+ # "totalNodes"=>2,
31
+ # "lostNodes"=>0,
32
+ # "unhealthyNodes"=>0,
33
+ # "decommissionedNodes"=>0,
34
+ # "rebootedNodes"=>0,
35
+ # "activeNodes"=>2}
36
+ ```
37
+
38
+
39
+ ## Get Info
40
+
41
+ ```
42
+ compute = Fog::Compute::Hadoop.new(@connection_params)
43
+ compute.get_info
44
+ ```
45
+
46
+ ```
47
+ # => {"id"=>1489170864142,
48
+ # "startedOn"=>1489170864142,
49
+ # "state"=>"STARTED",
50
+ # "haState"=>"ACTIVE",
51
+ # "resourceManagerVersion"=>"2.4.1",
52
+ # "resourceMan`agerBuildVersion"=>"2.4.1 from 1604318 by jenkins source checksum f74113c8e511baadac8fbc14827d8b85",
53
+ # "resourceManagerVersionBuiltOn"=>"2014-06-21T06:01Z",
54
+ # "hadoopVersion"=>"2.4.1",
55
+ # "hadoopBuildVersion"=>"2.4.1 from 1604318 by jenkins source checksum bb7ac0a3c73dc131f4844b873c74b630",
56
+ # "hadoopVersionBuiltOn"=>"2014-06-21T05:43Z"}
57
+ ```
58
+
59
+ ## Get Stats
60
+
61
+ ```
62
+ compute = Fog::Compute::Hadoop.new(@connection_params)
63
+ compute.get_app_stats
64
+ ```
65
+
66
+ ```
67
+ => [{"state"=>"SUBMITTED",
68
+ # "type"=>"*",
69
+ # "count"=>0},
70
+ # {"state"=>"NEW",
71
+ # "type"=>"*",
72
+ # "count"=>0},
73
+ # {"state"=>"KILLED",
74
+ # "type"=>"*",
75
+ # "count"=>0},
76
+ # {"state"=>"NEW_SAVING",
77
+ # "type"=>"*",
78
+ # "count"=>0},
79
+ # {"state"=>"RUNNING",
80
+ # "type"=>"*",
81
+ # "count"=>0},
82
+ # {"state"=>"FAILED",
83
+ # "type"=>"*",
84
+ # "count"=>0},
85
+ # {"state"=>"ACCEPTED",
86
+ # "type"=>"*",
87
+ # "count"=>0},
88
+ # {"state"=>"FINISHED",
89
+ # "type"=>"*",
90
+ # "count"=>0}]
91
+ ```
@@ -0,0 +1,60 @@
1
+ # Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2
+ #
3
+ # The MIT License (MIT)
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ # THE SOFTWARE.
22
+ # coding: utf-8
23
+ lib = File.expand_path('../lib', __FILE__)
24
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
25
+ require 'fog/hadoop/version'
26
+
27
+ Gem::Specification.new do |spec|
28
+ spec.name = "fog-hadoop"
29
+ spec.version = Fog::Hadoop::VERSION
30
+ spec.authors = ["Alberto Gutierrez"]
31
+ spec.email = ["aljesusg@gmail.com"]
32
+ spec.summary = %q{Module for the 'fog' gem to support Hadoop services.}
33
+ spec.description = %q{This library can be used as a module for `fog` or as standalone provider
34
+ to use the Hadoop services in applications..}
35
+ spec.homepage = "http://github.com/fog/fog-hadoop"
36
+ spec.license = "MIT"
37
+
38
+ spec.files = `git ls-files -z`.split("\x0")
39
+ spec.bindir = "exe"
40
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
41
+ spec.require_paths = ["lib"]
42
+
43
+ spec.add_dependency 'fog-core'
44
+ spec.add_dependency 'fog-json'
45
+
46
+ spec.add_development_dependency "bundler", "~> 1.5"
47
+ ## List your development dependencies here. Development dependencies are
48
+ ## those that are only needed during development
49
+ spec.add_development_dependency('minitest')
50
+ spec.add_development_dependency('rake')
51
+ spec.add_development_dependency('rbvmomi')
52
+ spec.add_development_dependency('yard')
53
+ spec.add_development_dependency('thor')
54
+ spec.add_development_dependency('rbovirt', '0.0.24')
55
+ spec.add_development_dependency('shindo', '~> 0.3.4')
56
+ spec.add_development_dependency('fission')
57
+ spec.add_development_dependency('pry')
58
+ spec.add_development_dependency('rubocop') if RUBY_VERSION > "1.9"
59
+ spec.add_development_dependency('codeclimate-test-reporter', '~> 1.0.0')
60
+ end