This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------------------------------------------------- | |
# SET TERRAFORM AND PROVIDER REQUIREMENTS | |
# --------------------------------------------------------------------------------------------------------------------- | |
terraform { | |
required_version = "~> 0.12.24" | |
required_providers { | |
aws = "~> 2.4" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------------------------------------------------- | |
# SET TERRAFORM AND PROVIDER REQUIREMENTS | |
# --------------------------------------------------------------------------------------------------------------------- | |
terraform { | |
required_version = "~> 0.12.24" | |
backend "s3" { | |
bucket = "github-terraform-example-terraform-state" | |
key = "organization/github-terraform-example/terraform.tfstate" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL := /bin/bash | |
MOUNT_TARGET_DIRECTORY = /app/src | |
BUILD_TOOLS_DOCKER_REPO = mineiros/build-tools | |
# Set default value for environment variable if there aren't set already | |
ifndef BUILD_TOOLS_VERSION | |
BUILD_TOOLS_VERSION := latest | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "iac-github" { | |
source = "mineiros-io/repository/github" | |
version = "~>0.1.0" | |
name = "iac-github" | |
private = true | |
description = "An example on how to manage a GitHub organization with Terraform." | |
allow_merge_commit = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: v1.0 | |
name: "IaC-Github CI Pipeline" | |
agent: | |
machine: | |
type: e1-standard-2 | |
os_image: ubuntu1804 | |
global_job_config: | |
env_vars: | |
- name: BUILD_TOOLS_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: v1.0 | |
name: "Deploy to GitHub" | |
agent: | |
machine: | |
type: e1-standard-2 | |
os_image: ubuntu1804 | |
global_job_config: | |
env_vars: | |
- name: BUILD_TOOLS_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "iac-github" { | |
source = "mineiros-io/repository/github" | |
version = "~> 0.1.0" | |
name = "iac-github" | |
private = true | |
description = "An example on how to manage a GitHub organization with Terraform." | |
allow_merge_commit = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func worker(wg *sync.WaitGroup, id int) { | |
defer wg.Done() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
def spawn_process(number): | |
print(f'Runs in separate process {number}') | |
if __name__ == '__main__': | |
max_processes = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process | Thread | |
---|---|---|
Processes are heavy-weight operations. | Threads are lighter-weight operations. | |
Processes can start new processes using e.g. [fork()](http://man7.org/linux/man-pages/man2/fork.2.html) (system call). | A process can start several threads using e.g [pthread_create()](http://man7.org/linux/man-pages/man3/pthread_create.3.html) (system call). | |
Each process lives in its own memory (address) space and holds a full copy of the program in memory which consume more memory. Processes don’t share memory with other processes. | Threads share memory with other threads of the same process. Threads within the same process live within the same address space and can thus easily access each other's data structures. The shared memory heaps and pools allow for reduced overhead of shared components. | |
Inter-process communication is slow as processes have different memory addresses. | Inter-thread communication can be faster than inter-process communication because threads of the same process share memory with the process they |