AWS Glacier

Let’s have a look at AWS Glacier

– Very low cost
– Storage service suitable for archiving data
– It is suitable for data that does not cause hindrance even when it takes time to take out and data that is not frequently accessed
– It is suitable for the case to be adopted as a replacement for conventional tape backup

It is said storage for backup.

To upload data such as photos, videos and other documents, need to use the AWS CLI. Althernatively, need to write code to make the upload request either directly using REST API or using the AWS SDK.

Amazon Glacier’s data is managed in units called Valut. Up to 1000 valuts can be created for each region, and up to 40 TB can be saved per Valut.

– Do not enable notification

As a concept feel like S3.

backup and recovery approach using AWS

Durability
Use 99.999999999% durability of safe storage of data provided by Amazon S3.

Security
Use flexible access control applicable to data transfer and storage and various encryption options.

Global infrastructure
Since it can be used all over the world, will use regions that comply with organization’s compliance requirements, local laws and regulations, standards etc.

Compliance
Since AWS complies with various security standards around the world including SOC, ISO 27001, PCI DSS, etc., it is possible to easily match the backup mechanism to existing compliance standards.

Scalability
Since a storage area that automatically changes according to the size of the backup data is provided, there is no need to manage the storage capacity

Reduced TCO
By using full managed services, operation costs are reduced, leading to a reduction in the total cost of ownership(TCO) of backup storage.

Price based on metered basis
Since it is a usage fee based on the used capacity and duration, a life cycle plan is set so that only data necessary for backup and recovery plan is saved.

The features of “classmethod”

https://classmethod.jp/

Described on the homepage that aws professional group solves the problem.

When examining company information, first of all it is a habit to see employment information.

First view shows project manager, aws integration.

Job detail
What kind of work do you do?
As a project manager, we will do project promotion in general. We will promote a series of work such as progress management and quality control from the planning and agreement of the project with the engineers and partners in the company.

Also, for customers who have already installed AWS, as an account manager as well as sales, we think about further use of AWS to solve problems of customers and solve business problems, and we will help you decide policy.

What kind of human resources are you looking for?
Those who have a strong will to make the project successful with customers. If problems occur, do not hold them alone, those who can deal with organizations and team involvement.

Wow, what engineer are doing is roughly the same with other places.

AWS operational design consultant
– Operational design work of service built by our company or customer
– Proposal of labor saving, automation by combining various services of AWS
– Support for operational design in order to acquire certification of our company or customer service.

With aws design, you have to understand aws in a great deal of detail.

Is not it listed? want to invest lol

AWS codedeploy

CodeDeploy is a managed service of AWS and can deploy source code and build artifacts for EC2 and on-premises servers and Lambda.

You can choose between in-place deployment and Blue / Green deployment to deploy to EC2 and on-premises servers.

You can select the source of the distribution from S3 and GitHub, but it will inevitably become s3 because the extension must be zip, tar, and tar.gz.

It is appsepec.yml that determines the rules for these deployment. Either type of appspeck.yml is required.

First of all, the content of the sample.zip file being uploaded to s3 are as follows. Assume that sample.jar is already built and star.sh describes the command to start it.

sample.zip
├── appspec.yml
├── sample.jar
└── start.sh

Travis CI push to S3

Precondition
– an account of GitHub
– a repository in GitHub
– an account of Travis CI
– Travis CI CLI installed (gem install travis)
– AWS account
– making an access ID and Secret Key with updated authority of S3 with IAM
– hosting buckets of S3 as static site

Create IAM User

GitHub

As an access key and a secret key are to be replaced later, is it OK?

language: php
php:
- 5.5
script: echo "do nothing"
deploy:
  provider: s3
  access_key_id:
    secure: "accesskey id"
  secret_access_key:
    secure: "secret access key"
  bucket: travisci-s3
  region: ap-northeast-1
  endpoint: s3.amazonaws.com
  on:
    branch: master

Perform a simple test with PHPUnit

I already tried installing PHPUnit, so I will try simple samples.

message.php

class Message
{
	private $message;
	public function __construct(string $message){
		$this->message = $message;
	}

	public function get(){
		return $this->message;
	}
}

messageTest.php

require_once ('../vendor/autoload.php');
require_once (dirname(__FILE__) .'../src/message.php');

use PHPUnit\Framework\TestCase;

class MessageTest extends TestCase{
	public function testGet(){
		$message = new Message('hello, world');
		$this->assertEquals('hello, world', $message->get());
	}
}

command line
[vagrant@localhost app]$ vendor/bin/phpunit tests
PHP Warning: require_once(../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/local/app/tests/messageTest.php on line 3
PHP Fatal error: require_once(): Failed opening required ‘../vendor/autoload.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /home/vagrant/local/app/tests/messageTest.php on line 3

fix

require_once ('./vendor/autoload.php');
require_once ('./src/message.php');

use PHPUnit\Framework\TestCase;

class MessageTest extends TestCase{
	public function testGet(){
		$message = new Message('hello, world');
		$this->assertEquals('hello, world', $message->get());
	}
}

[vagrant@localhost app]$ vendor/bin/phpunit tests
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.

. 1 / 1 (100%)

Time: 35 ms, Memory: 4.00MB

OK (1 test, 1 assertion)

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh^^

/usr/local/bin

Although the way of thinking differs depending on the operating system, in general /usr/local and below, it is used to keep compiled oneself.

/usr/bin and /bin put the standard command of the system, but place other thing in /usr/local/bin.

[vagrant@localhost app]$ echo $PATH
/home/vagrant/.pyenv/plugins/pyenv-virtualenv/shims:/home/vagrant/.pyenv/shims:/home/vagrant/.pyenv/bin:/home/vagrant/.rbenv/shims:/home/vagrant/.rbenv/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin

u, that’s strange..

What is PHPUnit

Unit test is a test to check the operation in units such as classes and functions that are the constituent elements of the program. By using PHPUnit, it is possible to create a unit test procedure as a PHP program and execute it as a batch process from a command line or the like.

Speaking of PHP program testing, it is common to manually check the screen transition by manipulating the browser manually, enter values in the form and check the result with the eyes. However, it is quite tedious task to open the page many times during development, enter the test data in the same way, and manually do all the results correctly.

The advantage of using PHPUnit that can automate and repetitively execute troublesome test procedures manually.

Since you can run the test as many times as you like with a single command, you can improve test efficiency and eliminate manual errors as well. In addition, the created test program replaces the specifications, confirming that existing process works correctly in the process of continually improving the program, so-called “degrate” it can also be used to prevent. It can lead to maintenance and improvement of program quality.

class Hello
{
	public function getMessage()
	{
		return "Hello world";
	}
}

It assumes that composer is already installed.
[vagrant@localhost app]$ php composer.phar require phpunit/phpunit:7.1.4
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 29 installs, 0 updates, 0 removals
– Installing sebastian/version (2.0.1): Loading from cache
– Installing sebastian/resource-operations (1.0.0): Loading from cache
– Installing sebastian/recursion-context (3.0.0): Loading from cache
– Installing sebastian/object-reflector (1.1.1): Loading from cache
– Installing sebastian/object-enumerator (3.0.3): Loading from cache
– Installing sebastian/global-state (2.0.0): Loading from cache
– Installing sebastian/exporter (3.1.0): Loading from cache
– Installing sebastian/environment (3.1.0): Loading from cache
– Installing sebastian/diff (3.0.1): Loading from cache
– Installing sebastian/comparator (3.0.2): Loading from cache
– Installing doctrine/instantiator (1.1.0): Loading from cache
– Installing phpunit/php-text-template (1.2.1): Loading from cache
– Installing phpunit/phpunit-mock-objects (6.1.2): Downloading (100%)
– Installing phpunit/php-timer (2.0.0): Loading from cache
– Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
– Installing theseer/tokenizer (1.1.0): Loading from cache
– Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
– Installing phpunit/php-token-stream (3.0.1): Downloading (100%)
– Installing phpunit/php-code-coverage (6.0.5): Downloading (100%)
– Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
– Installing webmozart/assert (1.4.0): Downloading (100%)
– Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
– Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
– Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache
– Installing phpspec/prophecy (1.8.0): Loading from cache
– Installing phar-io/version (1.0.1): Downloading (100%)
– Installing phar-io/manifest (1.0.1): Downloading (100%)
– Installing myclabs/deep-copy (1.8.1): Loading from cache
– Installing phpunit/phpunit (7.1.4): Downloading (100%)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating autoload files

[vagrant@localhost app]$ vendor/bin/phpunit –version
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.

What!?

Nest step, the path to use the phpunit command.

csv.z file

A file with the Z file extension is a UNIX compressed file. Like other archive file formats, Z file are used to compress a file for backup/archive purposes. However, unlike more complex formats, Z files can store just one file and no folders.

Z files can be opened with most zip/unzip programs.
Unix system can decompress .Z file without any software by using this command, where “name.z” is the name of the .Z file so as csv.z

Unix zcat command

It is a command that can be used on Unix system.
Display the contents of the compressed file with “gzip” command
Display the contents of the compressed file with “compress” command

Use it when displaying the contents of the compressed file!