Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump fog-core version to ~> 2.1 #422

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e25c68a
Bump fog-core version to 2.1.2
gildub Sep 19, 2018
d110066
Rename Fog::Compute::Google to Fog::Google::Compute
gildub Sep 20, 2018
4adb1db
Rename Fog::DNS::Google to Fog::Google::DNS
gildub Sep 20, 2018
c4b768c
Rename Fog::Storage::Google to Fog::Google::Storage
gildub Sep 20, 2018
422e28d
Rename Fog::Parsers::Storage::Google to Fog::Google::Parsers::Storage
gildub Sep 20, 2018
0ff179e
Autoload: consistent use of library path
gildub Sep 20, 2018
1e793df
Restore CHANGELOG, CONTRIBUTING and fix missing change in README
gildub Sep 20, 2018
0b13ab8
Autoload: Use double quotes
gildub Sep 20, 2018
91d7dc3
fog-core: Use ~> Major.Minor is better practice
gildub Sep 28, 2018
600ba59
Fix after rebase
gildub Sep 28, 2018
952a9da
relax fog-json constraint
pravi Nov 20, 2018
87ad757
Allow the api to close Tempfiles inline
itopalov Nov 21, 2018
d097fd2
Merge pull request #432 from pravi/patch-1
Temikus Nov 26, 2018
5cd625f
Do not load pry_byebug on JRuby
Temikus Oct 15, 2018
25e3bde
Add JRuby 9.1 to Travis
Temikus Oct 24, 2018
3a4f095
Add documentation to attached disk helper methods
Temikus Dec 10, 2018
1279881
Add tests for attached disk objects
Temikus Dec 10, 2018
11c6d4a
Consolidate logic of Disk.get_as_boot_disk
Temikus Dec 10, 2018
e5087a8
Add doc for get_as_boot_disk
Temikus Dec 10, 2018
834d7e2
Address linter
Temikus Dec 11, 2018
0713914
Merge pull request #433 from itopalov/patch-1
Temikus Dec 16, 2018
46c2f02
Add a new example for attached non-boot disks
Temikus Jan 3, 2019
22b84ec
Add a guard method for setting snapshot labels
Temikus Jan 3, 2019
5a68b15
Add an integration test for snapshots
Temikus Jan 3, 2019
9db334b
Update CHANGELOG
Temikus Jan 8, 2019
9815ecb
Remove EOL versions of ruby from Travis
Temikus Jan 8, 2019
89a91bc
Merge pull request #435 from Temikus/non_boot_disk
Temikus Jan 23, 2019
30f3441
Update CHANGELOG
Temikus Jan 23, 2019
aa7f084
Release 1.8.2
Temikus Jan 23, 2019
f5202c2
Merge pull request #437 from Temikus/release_182
Temikus Jan 23, 2019
119cf98
Update to Concourse v4
Temikus Mar 13, 2019
0b96e1a
Merge pull request #441 from Temikus/ci_upgrade
Temikus Mar 13, 2019
de57e6b
feat: Allow Google Application Default Credentials
hattorious Mar 19, 2019
9fe0b06
fix: Use Google's convenience function for Application Default Creden…
hattorious Mar 20, 2019
8bad94d
Merge pull request #442 from mavin/application-default-creds
Temikus Mar 20, 2019
03e91b1
Remove deprecated `google_client_email` option
Temikus Mar 20, 2019
1249eed
Remove leftover test for google_client_email
Temikus Mar 20, 2019
e625657
Rework auth workflow
Temikus Mar 20, 2019
9612f93
Put the fallback auth into a separate method
Temikus Mar 20, 2019
1e11db9
Rename cred name
Temikus Mar 20, 2019
5ba7505
Address linter
Temikus Mar 20, 2019
26e5ebd
Remove deprecated options from docs
Temikus Mar 21, 2019
c6b0533
Merge pull request #444 from Temikus/better_credential_workflow
Temikus Mar 21, 2019
1749e9b
Update service options with new client option
Temikus Mar 22, 2019
2e729c4
Merge pull request #446 from Temikus/update_service_parameters
Temikus Mar 22, 2019
9d6ab98
Bump version, update README and CHANGELOG
Temikus Mar 22, 2019
9f9dc99
Merge pull request #447 from Temikus/release-1_9_0
Temikus Mar 22, 2019
0ae812e
fix: Add `:google_application_default` as recognized argument Fog::Co…
hattorious Mar 27, 2019
2154d89
Merge pull request #448 from mavin/add-application-default-recognized…
Temikus Mar 27, 2019
2313ac8
Add a helper rake task to populate changelog
Temikus Mar 28, 2019
685d366
Merge pull request #449 from Temikus/rake_changelog
Temikus Mar 28, 2019
de64217
Release 1.9.1
Temikus Mar 28, 2019
4efe9cc
Merge pull request #450 from Temikus/release_191
Temikus Mar 28, 2019
7d28916
Insert a skip in SD pagination tests
Temikus Mar 28, 2019
7232ebb
Fix Address.disassociate method
Temikus Mar 28, 2019
511cea2
Increase Address model test coverage
Temikus Mar 28, 2019
67d3d06
Fix Address.associate method
Temikus Mar 28, 2019
4cd5962
Merge pull request #452 from Temikus/monitoring_test_issue
Temikus Mar 28, 2019
cd7b1c5
Cache bundling artefacts
Temikus Mar 28, 2019
83db5d9
Merge pull request #453 from Temikus/ci-caching
Temikus Mar 28, 2019
f376463
Merge branch 'fog-core-2+' of github.com:gildub/fog-google into gildu…
icco May 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .fog.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
# START GOOGLE CONFIG
my_google_credentials:
google_project: my-project-id
google_client_email: xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com
google_json_key_location: /path/to/my-project-xxxxxxxxxxxx.json
# You can also provide service account credentials with `google_json_key_string` or
# with `google_key_location` and `google_key_string` for P12 private keys.
# You can also provide service account credentials with `google_json_key_string`
# If so, uncomment the two following lines.
# HMAC credentials follow a similar format:
#google_storage_access_key_id: GOOGXXXXXXXXXXXXXXXX
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ dist: trusty
matrix:
fast_finish: true
include:
- rvm: 2.1
- rvm: 2.2
- rvm: 2.3
- rvm: 2.4
- rvm: 2.5
- rvm: jruby-9.1
- rvm: jruby-head
allow_failures:
- rvm: jruby-head
Expand Down
80 changes: 78 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,84 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Next

## 1.9.1

### User-facing

#### Fixed

- \#448 Add `:google_application_default` as recognized argument in
Fog::Compute::Google client [mavin]

### Development changes

#### Added

- \#449 Add a helper rake task to populate changelog [temikus]

## 1.9.0

### User-facing

#### Added

- \#442 Add support for Application Default credentials [mavin]
- This change allows the use of Application Default Credentials so that end
users can authenticate without a service account for development, testing,
and one-off interactions by using `:google_application_default`client
option. See README for more details.

### Fixed

- \#444 Remove deprecated `google_client_email` option from client parameters
[temikus]
- \#446 Updating service parameters to avoid "unrecognised parameter" warnings
when initializing Fog client with application default auth [temikus]

### Development changes

#### Fixed

- \#441 Update CI pipeline to Concourse V4 [temikus]
- \#444 Rework client authentication workflow [temikus]
- Separate different auth streams into private helper methods
- Add a fallback auth option - Google Application Default credentials
- Minor fixes and performance optimizations

## 1.8.2

### User-facing

#### Added

- \#435 Added additional examples for attached disks usage. [temikus]

#### Fixed

- \#433 Allow the api to close Tempfiles inline, improving disk utilization.
[itopalov]

### Development changes

#### Added

- \#425 Integration on Jruby + disk snapshot tests: [temikus]
- Adding JRuby 9.1 into Travis
- Added integration tests for disk snapshots

#### Fixed

- \#432 Relax fog-json constraint to minor version. [pravi]

- \#425 Miscellaneous dev improvements around JRuby and disk handling: [temikus]
- Fix bundling in development environment on JRuby
- Remove EOL versions of ruby from Travis
- Consolidated logic of `Disk.get_as_boot_disk` and increase doc coverage of
disk-associated methods.
- Add a guard a guard method for `Snapshot.add_labels`

## 1.8.1

### User-facing
Expand Down Expand Up @@ -260,8 +338,6 @@ We encourage people using 0.5.1 to upgrade.

## Template to use

## Next release

### User-facing

#### Changed
Expand Down
21 changes: 10 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Getting Involved

New contributors are always welcome, and when in doubt please ask questions!
New contributors are always welcome, and when in doubt please ask questions!
We strive to be an open and welcoming community. Please be nice to one another.

We recommend heading over to fog's [CONTRIBUTING](https://github.com/fog/fog/blob/master/CONTRIBUTING.md)
We recommend heading over to fog's [CONTRIBUTING](https://github.com/fog/fog/blob/master/CONTRIBUTING.md)
and having a look around as well. It has information and context about the state of the `fog` project as a whole.

### Coding
Expand Down Expand Up @@ -62,7 +62,7 @@ $ rake console
### Documentation

Code should be documented using [YARDoc](https://yardoc.org/) syntax.
We use [inch](https://github.com/rrrene/inch) to keep track of overall doc
We use [inch](https://github.com/rrrene/inch) to keep track of overall doc
coverage and [inch-ci](https://inch-ci.org/) to keep track of changes over time.

You can view a doc coverage report by running:
Expand All @@ -77,14 +77,14 @@ $ inch show Fog::Compute::Google::Server#set_metadata

### Testing

This module is tested with [Minitest](https://github.com/seattlerb/minitest).
This module is tested with [Minitest](https://github.com/seattlerb/minitest).

#### Integration tests

Live integration tests can be found in `test/integration/`.
Live integration tests can be found in `test/integration/`.

Most of the library functionality is currently covered with them. To simplify things for contributors we have a
CI system that runs all integration tests in parallel against all pull requests marked with `integrate` label
CI system that runs all integration tests in parallel against all pull requests marked with `integrate` label
that anyone in `fog-google` team can set. Read [CI section](https://github.com/fog/fog-google/blob/master/CONTRIBUTING.md#continuous-integration)
for more info.

Expand All @@ -94,7 +94,6 @@ make sure you have a `:test` credential in `~/.fog`, something like:
```
test:
google_project: my-project
google_client_email: [email protected]
google_json_key_location: /path/to/my-project-xxxxxxxxxxxxx.json
```

Expand Down Expand Up @@ -138,7 +137,7 @@ We're in progress of extending the library with more unit tests and contribution

#### The transition from `shindo` to Minitest

Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework.
Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework.
We've moved away from it, and to Minitest, but some artifacts may remain.

For more information on transition, read [#50](https://github.com/fog/fog-google/issues/50).
Expand All @@ -159,10 +158,10 @@ and contains the standard tests to run for all resources, (e.g. `test_lifecycle`
It also calls `cleanup` on the resource's factory during teardown, to make sure
that resources are getting destroyed before the next test run.
- The **factory**, (e.g. `ServersFactory`, in `test/integration/factories/servers_factory.rb`,)
automates the creation of resources and/or supplies parameters for explicit
automates the creation of resources and/or supplies parameters for explicit
creation of resources. For example, `ServersFactory` initializes a `DisksFactory`
to supply disks in order to create servers, and implements the `params` method
so that tests can create servers with unique names, correct zones and machine
so that tests can create servers with unique names, correct zones and machine
types, and automatically-created disks. `ServersFactory` inherits the `create`
method from `CollectionFactory`, which allows tests to create servers on-demand.
- The **main test**, (e.g. `TestServers`, in `test/integration/compute/test_servers.rb`,)
Expand All @@ -171,6 +170,6 @@ method from `CollectionFactory`, which allows tests to create servers on-demand.
it initializes a `ServersFactory`, and it includes any other tests specific to
this collection, (e.g. `test_bootstrap_ssh_destroy`).

If you want to create another resource, you should add live integration tests;
If you want to create another resource, you should add live integration tests;
all you need to do is create a factory in `test/integration/factories/my_resource_factory.rb`
and a main test in `test/integration/compute/test_my_resource.rb` that mixes in `TestCollection`.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ gem "inch", :require => false
gem "osrcry", :require => false
gem "rubocop", :require => false

# Debugger is specified here as it's not compatible with jRuby
gem "pry-byebug", :platforms => :ruby

# Specify your gem's dependencies in fog-google.gemspec
gemspec
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.

## Storage

There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Storage::Google` will automatically direct you to the appropriate API based on the credentials you provide it.
There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Google::Storage` will automatically direct you to the appropriate API based on the credentials you provide it.

* The [XML API](https://cloud.google.com/storage/docs/xml-api-overview/) is almost identical to S3. Use [Google's interoperability keys](https://cloud.google.com/storage/docs/migrating#keys) to access it.
* The new [JSON API](https://cloud.google.com/storage/docs/json_api/) is faster and uses auth similarly to the rest of the Google Cloud APIs using a [service account private key](https://developers.google.com/identity/protocols/OAuth2ServiceAccount).
Expand All @@ -23,21 +23,21 @@ There are two ways to access [Google Cloud Storage](https://cloud.google.com/sto

Google Compute Engine is a Virtual Machine hosting service. Currently it is built on version [v1](https://cloud.google.com/compute/docs/reference/v1/) of the GCE API.

As of 2017-12-15, we are still working on making Fog for Google Compute engine (`Fog::Compute::Google`) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.
As of 2017-12-15, we are still working on making Fog for Google Compute engine (`Fog::Google::Compute`) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.

## SQL

Fog implements [v1beta4](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/) of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like as we finish
adding remaining features.
Fog implements [v1beta4](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/) of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like as we finish
adding remaining features.

## DNS

Fog implements [v1](https://cloud.google.com/dns/api/v1/) of the Google Cloud DNS API. We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.

## Monitoring

Fog implements [v3](https://cloud.google.com/monitoring/api/v3/) of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups.
Fog implements [v3](https://cloud.google.com/monitoring/api/v3/) of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups.

We are always looking for people to improve our code and test coverage, so please [file issues](https://github.com/fog/fog-google/issues) for any anomalies you see or features you would like.

## Pubsub
Expand Down Expand Up @@ -94,6 +94,20 @@ cat .fog.example >> ~/.fog # appends the sample configuration
vim ~/.fog # edit file with yout config
```

As of `1.9.0` fog-google supports Google [application default credentials (ADC)](https://cloud.google.com/docs/authentication/production)
The auth method uses [Google::Auth.get_application_default](https://www.rubydoc.info/gems/googleauth/0.6.7/Google%2FAuth.get_application_default)
under the hood.

Example workflow for a GCE instance with [service account scopes](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances)
defined:

```
> connection = Fog::Compute::Google.new(:google_project => "my-project", :google_application_default => true)
=> #<Fog::Compute::Google::Real:32157700...
> connection.servers
=> [ <Fog::Compute::Google::Server ... ]
```

#### SSH-ing into instances

If you want to be able to bootstrap SSH-able instances, (using `servers.bootstrap`,) be sure you have a key in `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`
Expand All @@ -105,9 +119,9 @@ Once you've specified your credentials, you should be good to go!
$ bundle exec pry
[1] pry(main)> require 'fog/google'
=> true
[2] pry(main)> connection = Fog::Compute::Google.new
[2] pry(main)> connection = Fog::Google::Compute.new
[3] pry(main)> connection.servers
=> [ <Fog::Compute::Google::Server
=> [ <Fog::Google::Compute::Server
name="xxxxxxx",
kind="compute#instance",
```
Expand All @@ -117,7 +131,7 @@ $ bundle exec pry
Fog-google is currently supported on Ruby 2.3+.

In general we support (and run our CI) for Ruby versions that are actively supported
by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/
for details about the Ruby support schedule.

Expand Down
13 changes: 6 additions & 7 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ PR when the test completes.

In order to run the fog-google Concourse Pipeline you must have an existing
[Concourse](http://concourse.ci) environment.
See [Deploying Concourse on Google Compute Engine](https://github.com/cloudfoundry-incubator/bosh-google-cpi-release/blob/master/docs/concourse/README.md)
for instructions.

To deploy the pipeline:

Expand All @@ -28,32 +26,33 @@ file. See [Credentials Requirements](#credentials-requirements) for specific ins
* Set the fog-google pipeline:

```
fly -t fog-ci set-pipeline -p fog-google -c pipeline.yml -l credentials.yml
fly -t fog-ci set-pipeline -p pr-integration -c pipeline.yml -l credentials.yml
```

* Unpause the fog-google pipeline:

```
fly -t fog-ci unpause-pipeline -p fog-google
fly -t fog-ci unpause-pipeline -p pr-integration
```

## Credentials Requirements

Several external pieces of authentication are needed for credentials.yml

1. A JSON Service Account File for a service account with at least Editor access to the project.
* To get a Service Account File, see [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount)
* To get a Service Account File, see [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount)
and create using the Project/Editor role.

1. A [Github Access Token](https://github.com/blog/1509-personal-api-tokens) with at least
`repo:status` access and a private key with push access to the `fog/fog-google` repositoy.

1. A [Codecov.io](https://codecov.io/) token for tracking test coverage.

These items are equivalent to your login credentials for their resources.

## Login Gotchas

* If your Concourse deployment is using a self-signed certificate, use `--insecure` to
trust the provided certificate.
* Our concourse pipeline is using GitHub auth, providing access to manipulate the pipeline to the members of the [fog-google team](https://github.com/orgs/fog/teams/fog-google), managed through the OAuth application managed by [fog-google bot](https://github.com/fog-google-bot).

* If logging into a specific team, ie `fog-google`, use `--team-name fog-google` to specify that.

Expand Down
2 changes: 0 additions & 2 deletions ci/credentials.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
codecov_token:
# Google Cloud Platform project to run under
google_project:
# Google Compute Engine Service Account email
google_client_email:
# Google Compute Engine Service Account JSON
google_json_key_data: |
{
Expand Down
58 changes: 58 additions & 0 deletions ci/pipeline-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
jobs:
- name: integration-tests-monitoring
serial: true
plan:
- get: fog-google-src
resource: pull-request
version: every
trigger: true
- put: pull-request
params: {path: fog-google-src, status: pending}

- task: run-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:monitoring
codecov_token: {{codecov_token}}
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
on_failure:
put: pull-request
params:
path: fog-google-src
status: failure

- name: github-pr-aggregator
plan:
- get: fog-google-src
resource: pull-request
passed: [integration-tests-monitoring]
trigger: true
on_success:
put: pull-request
params:
path: fog-google-src
status: success
on_failure:
put: pull-request
params:
path: fog-google-src
status: failure

resources:
- name: pull-request
type: pull-request
source:
access_token: {{github_access_token}}
private_key: {{github_private_key}}
label: integrate-dev
repo: fog/fog-google

resource_types:
# This is a third party resource.
# The referenced docker-image is maintained externally
# https://github.com/jtarchie/pullrequest-resource
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr
Loading