Skip to content

Commit

Permalink
auth
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Jul 17, 2023
1 parent 4338646 commit a42a50a
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/night.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
vintner instances create --instance motivation --template motivation
vintner instances resolve --instance motivation --presets prod
cp examples/xopera-motivation/inputs.example.yaml examples/xopera-motivation/deployment-inputs.ignored.yaml
cp examples/xopera-motivation/deployment-inputs.example.yaml examples/xopera-motivation/deployment-inputs.ignored.yaml
sed -i "/gcp_service_account_file:/c\gcp_service_account_file: $(pwd)/gcp-credentials.json" examples/xopera-motivation/deployment-inputs.ignored.yaml
vintner instances deploy --instance motivation --inputs examples/xopera-motivation/deployment-inputs.ignored.yaml
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenTOSCA Vintner

> Check out the [step-by-step guide](https://vintner.opentosca.org/variability4tosca/guides/artifacts) for the publication submitted at _CoopIS 2023_. Additional links are [below](#step-by-step-guides).
> Check out the [step-by-step guide](https://vintner.opentosca.org/variability4tosca/guides/artifacts) for the publication submitted at _CoopIS 2023_. Additional links are [below](#stoetzner-2023-VDMMv2).
[![Release](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml/badge.svg?branch=main)](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml)
[![Night](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml/badge.svg)](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml)
Expand Down Expand Up @@ -29,14 +29,15 @@ This repository holds the following specifications and profiles.

This repository holds the step-by-step guides of the following publications.

<a id="stoetzner-2023-VDMMv2"></a>
- **Managing the Variability of Component Implementations and Their Deployment Configurations Across Heterogeneous Deployment Technologies**
- CoopIS 2023
- _Currently under Review_
- [Step-by-Step Guide](https://vintner.opentosca.org/variability4tosca/guides/artifacts)
- [Model of the Motivating Scenario](examples/unfurl-artifacts)
- [Models of the Complexity Evaluation](examples/unfurl-artifacts/stats)


<a id="stoetzner-2022-VDMM"></a>
- **Modeling Different Deployment Variants of a Composite Application in a Single Declarative Deployment Model**
- Algorithms 2022
- https://doi.org/10.3390/a15100382
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/variability4tosca/guides/pruning/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ vintner orchestrators enable --orchestrator xopera

Deploy the cloud variant of the pruning application.
Therefore, import the template, create an instance, resolve the variability and finally deploy the application.
An example for the deployment inputs is given in {{ repo_link('examples/xopera-pruning/inputs.example.yaml') }}.
An example for the deployment inputs is given in {{ repo_link('examples/xopera-pruning/deployment-inputs.example.yaml') }}.

```shell linenums="1"
# Add variable service template
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/variability4tosca/motivation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The deployment will take some minutes.

```shell linenums="1"
# Deploy instance
# See examples/xopera-motivation/inputs.example.yaml as reference
# See examples/xopera-motivation/deployment-inputs.example.yaml as reference
vintner instances deploy --instance motivation --inputs ${INPUTS_PATH}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ release: abcdefgh

gcp_region: europe-west3
gcp_service_account_file: '***********************'
gcp_project: stoetzms-387808

root_password: some-secret

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Create GCP Engine App
- name: Create GCP App Engine
hosts: all
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'

# https://cloud.google.com/sql/docs/mysql/connect-instance-cloud-shell
- name: Enable Cloud Build API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'

# https://cloud.google.com/sql/docs/mysql/create-manage-databases
- name: Create Database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'

# https://cloud.google.com/sql/docs/mysql/create-manage-databases
- name: Create Database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'

# https://cloud.google.com/sql/docs/mysql/connect-instance-cloud-shell
- name: Enable Cloud SQL Admin API
Expand Down
39 changes: 34 additions & 5 deletions examples/xopera-motivation/lib/gcp/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ node_types:
type: string
service_account_file:
type: string
project:
type: string
capabilities:
host:
type: tosca.capabilities.Compute
Expand All @@ -30,18 +32,21 @@ node_types:
root_password:
type: string

authorized_networks:
type: string
# default: 0.0.0.0/0

region:
type: string
default: {get_property: [SELF, host, region]}
# default: europe-west3

service_account_file:
type: string
default: {get_property: [SELF, host, service_account_file]}

authorized_networks:
project:
type: string
# default: 0.0.0.0/0
default: {get_property: [SELF, host, project]}

attributes:
public_address:
Expand Down Expand Up @@ -76,6 +81,10 @@ node_types:
type: string
value: {get_property: [SELF, root_password]}

authorized_networks:
type: string
value: {get_property: [SELF, authorized_networks]}

region:
type: string
value: {get_property: [SELF, region]}
Expand All @@ -84,9 +93,9 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}

authorized_networks:
project:
type: string
value: {get_property: [SELF, authorized_networks]}
default: {get_property: [SELF, project]}

operations:
create: sql/dbms/playbooks/create.yaml
Expand All @@ -113,6 +122,10 @@ node_types:
type: string
default: {get_property: [SELF, host, service_account_file]}

region:
type: string
default: {get_property: [SELF, host, region]}

capabilities:
database:
type: tosca.capabilities.Endpoint.Database
Expand All @@ -137,6 +150,14 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}

region:
type: string
value: {get_property: [SELF, region]}

project:
type: string
default: {get_property: [SELF, project]}

operations:
create: sql/db/playbooks/create.yaml
delete: sql/db/playbooks/delete.yaml
Expand All @@ -156,6 +177,10 @@ node_types:
type: string
default: {get_property: [SELF, host, service_account_file]}

project:
type: string
default: {get_property: [SELF, HOST, project]}

capabilities:
host:
type: tosca.capabilities.Compute
Expand All @@ -176,5 +201,9 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}

project:
type: string
default: {get_property: [SELF, project]}

operations:
create: appengine/engine/playbooks/create.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Create GCP Engine App
- name: Create GCP Node Application
hosts: all
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }} --project {{ gcp_project }}'

- name: Create working directory
tempfile:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Create GCP Engine App
- name: Delete GCP Node Application
hosts: all
gather_facts: false
tasks:
- name: active service account
shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }}'
shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }} --project {{ gcp_project }}'

- name: Create App
shell: 'gcloud app services delete {{ application_name }} --quiet'
13 changes: 13 additions & 0 deletions examples/xopera-motivation/lib/node/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ node_types:
gcp_service_account_file:
type: string

gcp_region:
type: string

gcp_project:
type: string

attributes:
public_address:
type: string
Expand Down Expand Up @@ -103,6 +109,13 @@ node_types:
type: string
value: {get_property: [SELF, gcp_service_account_file]}

gcp_region:
type: string
value: {get_property: [SELF, gcp_region]}

gcp_project:
type: string
value: {get_property: [SELF, gcp_project]}
operations:
create:
implementation:
Expand Down
3 changes: 3 additions & 0 deletions examples/xopera-motivation/variable-service-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ topology_template:
vm_ssh_user: {get_input: private_vm_ssh_user}
vm_ssh_key_file: {get_input: private_vm_ssh_key_file}
gcp_service_account_file: {get_input: gcp_service_account_file}
gcp_project: {get_input: gcp_project}
gcp_region: {get_input: gcp_region}
requirements:
- host:
node: dev_runtime
Expand Down Expand Up @@ -148,6 +150,7 @@ topology_template:
properties:
region: {get_input: gcp_region}
service_account_file: {get_input: gcp_service_account_file}
project: {get_input: gcp_project}

dev_runtime:
type: node.runtime
Expand Down

0 comments on commit a42a50a

Please sign in to comment.