Skip to content

Commit 5add07c

Browse files
committed
Initial commit
Signed-off-by: Stephen Brennan <[email protected]>
0 parents  commit 5add07c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12386
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.pyc
2+
__pycache__
3+
yo.egg-info
4+
build
5+
dist
6+
.tox
7+
.coverage

.pre-commit-config.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/psf/black
12+
rev: "23.1.0"
13+
hooks:
14+
- id: black
15+
args: [--line-length=80, --exclude=setup.py]
16+
- repo: https://github.com/pycqa/flake8
17+
rev: "6.0.0"
18+
hooks:
19+
- id: flake8
20+
- repo: https://github.com/pre-commit/mirrors-mypy
21+
rev: "v1.0.1"
22+
hooks:
23+
- id: mypy
24+
args: [--strict, --disallow-untyped-calls]
25+
exclude: "(tests|doc)/.*"
26+
additional_dependencies:
27+
- types-setuptools
28+
- rich
29+
- subc
30+
- repo: https://github.com/asottile/reorder_python_imports
31+
rev: v3.9.0
32+
hooks:
33+
- id: reorder-python-imports
34+
- repo: https://github.com/netromdk/vermin
35+
rev: v1.5.1
36+
hooks:
37+
- id: vermin
38+
args: ['-t=3.6-', '--violations', '--backport', 'dataclasses']

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Changelog
2+
=========
3+
4+
Unreleased
5+
----------
6+
7+
In the beginning, there was darkness...

CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing to this repository
2+
3+
We welcome your contributions! There are multiple ways to contribute.
4+
5+
## Opening issues
6+
7+
For bugs or enhancement requests, please file a GitHub issue unless it's
8+
security related. When filing a bug remember that the better written the bug is,
9+
the more likely it is to be fixed. If you think you've found a security
10+
vulnerability, do not raise a GitHub issue and follow the instructions in our
11+
[security policy](./SECURITY.md).
12+
13+
## Contributing code
14+
15+
We welcome your code contributions. Before submitting code via a pull request,
16+
you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and
17+
your commits need to include the following line using the name and e-mail
18+
address you used to sign the OCA:
19+
20+
```text
21+
Signed-off-by: Your Name <[email protected]>
22+
```
23+
24+
This can be automatically added to pull requests by committing with `--sign-off`
25+
or `-s`, e.g.
26+
27+
```text
28+
git commit --signoff
29+
```
30+
31+
Only pull requests from committers that can be verified as having signed the OCA
32+
can be accepted.
33+
34+
## Pull request process
35+
36+
1. Ensure there is an issue created to track and discuss the fix or enhancement
37+
you intend to submit.
38+
1. Fork this repository.
39+
1. Create a branch in your fork to implement the changes. We recommend using
40+
the issue number as part of your branch name, e.g. `1234-fixes`.
41+
1. Ensure that any documentation is updated with the changes that are required
42+
by your change.
43+
1. Ensure that any samples are updated if the base image has been changed.
44+
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
45+
what your changes are meant to do and provide simple steps on how to validate.
46+
your changes. Ensure that you reference the issue you created as well.
47+
1. We will assign the pull request to 2-3 people for review before it is merged.
48+
49+
## Code of conduct
50+
51+
Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd
52+
like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC].
53+
54+
[OCA]: https://oca.opensource.oracle.com
55+
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/

LICENSE.txt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2023, Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the
15+
lrgrwrks.txt file if one is included with the Software (each a "Larger
16+
Work" to which the Software is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.

Makefile

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
#
3+
# The Universal Permissive License (UPL), Version 1.0
4+
#
5+
# Subject to the condition set forth below, permission is hereby granted to any
6+
# person obtaining a copy of this software, associated documentation and/or data
7+
# (collectively the "Software"), free of charge and under any and all copyright
8+
# rights in the Software, and any and all patent rights owned or freely
9+
# licensable by each licensor hereunder covering either (i) the unmodified
10+
# Software as contributed to or provided by such licensor, or (ii) the Larger
11+
# Works (as defined below), to deal in both
12+
#
13+
# (a) the Software, and
14+
# (b) any piece of software and/or hardware listed in the
15+
# lrgrwrks.txt file if one is included with the Software (each a "Larger
16+
# Work" to which the Software is contributed by such licensors),
17+
#
18+
# without restriction, including without limitation the rights to copy, create
19+
# derivative works of, display, perform, and distribute the Software and make,
20+
# use, sell, offer for sale, import, export, have made, and have sold the
21+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
# either these or other terms.
23+
#
24+
# This license is subject to the following condition: The above copyright notice
25+
# and either this complete permission notice or at a minimum a reference to the
26+
# UPL must be included in all copies or substantial portions of the Software.
27+
#
28+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34+
# SOFTWARE.
35+
36+
VERSION=$(shell grep 'VERSION =' setup.py | sed s/\"//g | awk '{print($$3)}')
37+
38+
PYTHON ?= python3
39+
pyver_maj = $(shell $(PYTHON) --version | cut -d. -f1 | sed 's/Python //')
40+
pyver_min = $(shell $(PYTHON) --version | cut -d. -f2)
41+
42+
.PHONY: development
43+
development:
44+
@if [ $(pyver_maj) -ne 3 ] || [ $(pyver_min) -lt 6 ]; then \
45+
echo error: Your Python $(pyver_maj).$(pyver_min), from command \"$(PYTHON)\", is not supported; \
46+
echo Yo requires Python 3.6 or newer.; \
47+
echo If you have another installed, try using make PYTHON=/path/to/python; \
48+
exit 1; \
49+
fi
50+
$(PYTHON) -m pip install --user --upgrade tox pre-commit
51+
$(PYTHON) -m pre_commit install --install-hooks
52+
53+
.PHONY: test
54+
test:
55+
@$(PYTHON) -m tox
56+
57+
.PHONY: docs
58+
docs:
59+
@$(PYTHON) -m tox -e docs
60+
61+
.PHONY: docs-publish
62+
docs-publish: docs
63+
rsync -avz .tox/docs_out/ ca-common:public_html/yo
64+
65+
.PHONY: _release_sanity_check
66+
_release_sanity_check:
67+
@if [ ! $$(git symbolic-ref -q HEAD) = "refs/heads/master" ]; then \
68+
echo error: You must be on master to release a new version.; \
69+
exit 1; \
70+
fi
71+
@if [ ! -z "$$(git status --porcelain)" ]; then \
72+
echo error: Your git tree is unclean, please commit or stash it.; \
73+
exit 1; \
74+
fi
75+
@if [ "$$(git describe --tags --abbrev=0)" = "$(VERSION)" ]; then \
76+
echo error: It looks like you have not bumped the version since last release.; \
77+
exit 1; \
78+
fi
79+
@if [ -z "$$(grep ^$(shell echo $(VERSION) | sed 's/\./\\./g') CHANGELOG.md)" ]; then \
80+
echo error: It looks like you have not documented this release in CHANGELOG.md; \
81+
exit 1; \
82+
fi
83+
@if [ -f dist/yo-$(VERSION).tar.gz ]; then \
84+
echo error: There is already a built tarball: dist/yo-$(VERSION).tar.gz; \
85+
echo Either verify you have bumped the version, or delete the; \
86+
echo distributions you have built for $(VERSION); \
87+
exit 1; \
88+
fi
89+
90+
91+
.PHONY: release
92+
release: _release_sanity_check test
93+
$(PYTHON) setup.py sdist
94+
$(PYTHON) setup.py bdist_wheel
95+
@echo "Built the following artifacts for yo $(VERSION):"
96+
@ls -l dist/yo-$(VERSION)*
97+
@echo "Point of no return: time to tag and upload this release"
98+
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
99+
@echo Confirmed
100+
twine upload -r oracle dist/yo-$(VERSION)*
101+
git push origin master
102+
git tag v$(VERSION)
103+
git push origin v$(VERSION)

README.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
yo - fast and simple OCI client
2+
===============================
3+
4+
yo is a command-line client for managing OCI instances. It makes launching OCI
5+
instances as simple as rudely telling your computer "yo, launch an instance".
6+
Its goals are speed, ease of use, and simplicity. It was originally designed to
7+
help developers in the Oracle Linux team quickly launch disposable VMs for
8+
testing, but is slowly gaining users outside of OL. Here are some examples of
9+
how yo tries to improve on the OCI command line and browser tools:
10+
11+
- yo hides other people's VMs from you, so you can just manage your own
12+
instances.
13+
- yo doesn't make you type any more than you need. Compartment IDs, common shape
14+
configurations, etc can all be stored in your config. It really can be as
15+
simple as `yo launch` (or, for the lazier, `yo la`).
16+
- yo lets you refer to your instances by name. You should never need to memorize
17+
an IP address again.
18+
- yo aggressively caches data to make operations as quick as possible.
19+
20+
Installation
21+
------------
22+
23+
A minimum of Python 3.6 is required in order to use Yo.
24+
25+
**Via Pip:**
26+
27+
Yo is not currently available on the Python Package Index. Check back soon!
28+
29+
**From Source:**
30+
31+
Clone the repository, and then install with:
32+
33+
python setup.py install
34+
35+
After installation, you'll need to configure Yo to work with your OCI tenancy.
36+
Please see the [documentation][] for detailed instructions.
37+
38+
Documentation
39+
-------------
40+
41+
The [documentation][] contains information on the configuration file, as well as
42+
a listing of sub-commands and features offered.
43+
44+
Examples
45+
--------
46+
47+
```bash
48+
# Launch an instance based on your default settings, and SSH into it
49+
yo launch -s
50+
51+
# Launch a flexible instance with given shape, size, and name
52+
yo launch -S VM.Standard.x86.Generic --cpu 3 --mem 12 -n my-vm
53+
54+
# SSH into my-vm
55+
yo ssh my-vm
56+
57+
# Copy files to my-vm
58+
yo scp ./files my-vm:
59+
60+
# Terminate my-vm
61+
yo terminate my-vm
62+
```
63+
64+
Help
65+
----
66+
67+
We hope you can find all the answers to your questions in our documentation. But
68+
if you're still having trouble, feel free to open a Github issue and we'll try
69+
our best to help!
70+
71+
Contributing
72+
------------
73+
74+
We welcome contributions from the community. Before submitting a pull request,
75+
please [review our contribution guide][contributing].
76+
77+
Security
78+
--------
79+
80+
Please consult the [security guide][security] for our responsible security
81+
vulnerability disclosure process.
82+
83+
License
84+
-------
85+
86+
Copyright (c) 2022 Oracle and/or its affiliates.
87+
88+
Released under the Universal Permissive License v1.0 as shown at
89+
https://oss.oracle.com/licenses/upl/.
90+
91+
[documentation]: https://oracle-samples.github.io/yo/
92+
[contributing]: ./CONTRIBUTING.md
93+
[security]: ./SECURITY.md

SECURITY.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Reporting security vulnerabilities
2+
3+
Oracle values the independent security research community and believes that
4+
responsible disclosure of security vulnerabilities helps us ensure the security
5+
and privacy of all our users.
6+
7+
Please do NOT raise a GitHub Issue to report a security vulnerability. If you
8+
believe you have found a security vulnerability, please submit a report to
9+
[[email protected]][1] preferably with a proof of concept. Please review
10+
some additional information on [how to report security vulnerabilities to Oracle][2].
11+
We encourage people who contact Oracle Security to use email encryption using
12+
[our encryption key][3].
13+
14+
We ask that you do not use other channels or contact the project maintainers
15+
directly.
16+
17+
Non-vulnerability related security issues including ideas for new or improved
18+
security features are welcome on GitHub Issues.
19+
20+
## Security updates, alerts and bulletins
21+
22+
Security updates will be released on a regular cadence. Many of our projects
23+
will typically release security fixes in conjunction with the
24+
[Oracle Critical Patch Update][3] program. Additional
25+
information, including past advisories, is available on our [security alerts][4]
26+
page.
27+
28+
## Security-related information
29+
30+
We will provide security related information such as a threat model, considerations
31+
for secure use, or any known security issues in our documentation. Please note
32+
that labs and sample code are intended to demonstrate a concept and may not be
33+
sufficiently hardened for production use.
34+
35+
[1]: mailto:[email protected]
36+
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
37+
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
38+
[4]: https://www.oracle.com/security-alerts/

0 commit comments

Comments
 (0)