#docker memo command
Explore tagged Tumblr posts
kureeeen · 6 years ago
Text
Extract Docker Image as tar file
# docker save -o <path for tar file> <docker image name>
to load it,
# docker load -i <path to tar file>
0 notes
awsexchage · 7 years ago
Photo
Tumblr media
PythonのFlaskでMySQLを利用したRESTfulなAPIをDocker環境で実装する https://ift.tt/2ABlvR8
概要
Flaskを利用してRESTfulなAPIを実装する場合、いくつかのモジュールを導入するといい感じに実装できるのですが、モジュールそれぞれのドキュメントはあるものの、じゃあ合わせて利用するには?って記事が少なかったのでまとめてみました。
今回利用したソースはGitHubにアップしています。
kai-kou/flask-mysql-restful-api-on-docker https://github.com/kai-kou/flask-mysql-restful-api-on-docker
環境
MacでDockerコンテナ上で動作する環境をつくりました。 MySQLもDockerコンテナで動作させます。
> docker --version Docker version 18.06.1-ce, build e68fc7a > docker-compose --version docker-compose version 1.22.0, build f46880f
利用したモジュール
気がついたらこんなに利用していました。 各モジュールを利用するにあたり公式や参考にさせてもらった記事をざっくりとまとめておきます。 ひととおり動作するところまで進んで、Django使ったほうが早かったかもと後悔したのは、また別のお話。
Flask
Flask-RESTful
SQLAlchemy
Flask-SQLAlchemy
Flask-Migrate
Flask-Marshmallow
PyMySQL
Gunicorn
Flask
軽量Webフレームワークですね。簡単なWebアプリケーションであれば、これだけですぐに実装ができるのですが、その反面実現したいことによっては利用するモジュールが増えます。増えました。
Flask http://flask.pocoo.org/
[Python] 軽量WebフレームワークのFlaskに入門(準備、起動、HTML、静的ファイル、GET、POSTなど) https://www.yoheim.net/blog.php?q=20160505
Flask-RESTful
Flask単体でもRESTfulなAPIは実装できるのですが、実装をすっきりさせたかったので、導入しています。
Flask-RESTful https://flask-restful.readthedocs.io/en/latest/
こちらの記事が詳し��ったです。感謝!
Flask-RESTful – KZKY memo http://kzky.hatenablog.com/entry/2015/11/02/Flask-Restful
SQLAlchemy
Pythonで定番のORM(オブジェクト・リレーショナル・マッパー)モジュールです。SQLを書かなくても良いのです。
SQLAlchemy – The Database Toolkit for Python https://www.sqlalchemy.org/
Python3 の 定番ORM 「 SQLAlchemy 」で MySQL ・ SQLite 等を操作 – 導入からサンプルコード https://it-engineer-lab.com/archives/1183
Flask-SQLAlchemy
FlaskでSQLAlchemyを簡単に利用するためのモジュールです。
Flask-SQLAlchemy http://flask-sqlalchemy.pocoo.org/2.1/
Flask-SQLAlchemyの使い方 https://qiita.com/msrks/items/673c083ca91f000d3ed1
Flask-Migrate
DBスキーマをマイグレーション管理するのに利用します。
Alembicを使用したFlask+SQLAlchemyでマイグレーションするための拡張だそうです。(公式より) 自分でマイグレーションファイルを作成しなくても良いのがとても魅力的です。
Flask-Migrate documentation https://flask-migrate.readthedocs.io/en/latest/
Flask + SQLAlchemyプロジェクトを始める手順 https://qiita.com/shirakiya/items/0114d51e9c189658002e
Flask-Marshmallow
Flask-SQLAlchemyで取り扱うモデルをJSONに変換してくれるモジュールです。 マシュマロって名前が良いですね。
Flask-Marshmallow https://flask-marshmallow.readthedocs.io/en/latest/
SQLAlchemy x marshmallowでModelからJSONへの変換を楽に行う https://techblog.recochoku.jp/3107
marshmallow-sqlalchemy
Flask-Marshmallowを利用するのに必要となります。
marshmallow-sqlalchemy https://marshmallow-sqlalchemy.readthedocs.io/en/latest/
PyMySQL
PythonのMySQLクライアントモジュールです。
PyMySQL https://github.com/PyMySQL/PyMySQL
Gunicorn
DockerでFlaskアプリを動作させるのに利用しています。
Gunicorn – Python WSGI HTTP Server for UNIX https://gunicorn.org/
ファイル構成
今回のファイル構成です。 それぞれのファイルについて説明をしていきます。 __init__.py は今回空ですが、作成していないと、import でハマるので、侮ってはいけません(1敗
> tree . ├── Dockerfile ├── docker-compose.yml ├── mysql │ ├── Dockerfile │ ├── my.cnf │ └── sqls │ └── initialize.sql └── src ├── __init__.py ├── apis │ └── hoge.py ├── app.py ├── config.py ├── database.py ├── models │ ├── __init__.py │ └── hoge.py ├── requirements.txt └── run.py
Dockerの環境設定
MySQLの設定
MySQLの設定に関しては下記を参考にさせていただきました。
docker-composeとMySQL公式イメージで簡単に開発環境用DBを作る https://qiita.com/K_ichi/items/e8826c300e797b90e40f
docker-compose.yaml(一部抜粋)
version: '3' services: (略) db: build: ./mysql/ volumes: - ./mysql/mysql_data:/var/lib/mysql # データの永続化 - ./mysql/sqls:/docker-entrypoint-initdb.d # 初期化時に実行するSQL environment: - MYSQL_ROOT_PASSWORD=hoge # パスワードはお好みで
mysql/Dockerfile
FROM mysql EXPOSE 3306 ADD ./my.cnf /etc/mysql/conf.d/my.cnf # 設定ファイルの読み込み CMD ["mysqld"]
文字コードの設定
mysql/my.cnf
[mysqld] character-set-server=utf8 [mysql] default-character-set=utf8 [client] default-character-set=utf8
今回利用するデータベースが初期化時に作成されるようにします。
mysql/sqls/initialize.sql
CREATE DATABASE hoge; use hoge;
動作確認
MySQLのDockerコンテナが立ち上がるか確認するには以下のようにします。
> docker-compose build db > docker-compose up -d db > docker-compose exec db mysql -u root -p Enter password: (略) Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
はい。
つながったらデータベースが作成されているか確認しておきます。
mysql> show databases; +--------------------+ | Database | +--------------------+ | hoge | | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.01 sec)
Flaskの設定
Flaskを動作させるDocker Composeの設定を確認します。
下記記事の設定をベースにしています。
Python+Flask環境をDockerで構築する https://cloudpack.media/43978
flask コマンドが実行できるように環境変数を指定しています。 services.api.command でflask run コマンドを指定して、Flaskアプリが起動するようにしています。-h 0.0.0.0 オプションの指定がないとDockerコンテナ外からアクセスできないので、ご注意ください。
docker-compose.yml(完全版)
version: '3' services: api: build: . ports: - "5000:5000" volumes: - "./src:/src" tty: true environment: TZ: Asia/Tokyo FLASK_APP: run.py FLASK_ENV: development command: flask run -h 0.0.0.0 db: build: ./mysql/ volumes: - ./mysql/mysql_data:/var/lib/mysql - ./mysql/sqls:/docker-entrypoint-initdb.d environment: - MYSQL_ROOT_PASSWORD=hoge
Dockerfileでpip install するようにしています。
Dockerfile
FROM python:3.6 ARG project_dir=/src/ ADD src/requirements.txt $project_dir WORKDIR $project_dir RUN pip install -r requirements.txt
最初に紹介したモジュールを指定しています。
requirements.txt
flask sqlalchemy flask-restful flask-sqlalchemy sqlalchemy_utils flask-migrate pymysql gunicorn flask_marshmallow marshmallow-sqlalchemy
動作確認
こちらもDockerコンテナが起動するか確認するには以下のようにします。
> docker-compose build api > docker-compose up -d api > docker-compose logs api (略) api_1 | * Serving Flask app "run.py" (lazy loading) api_1 | * Environment: development api_1 | * Debug mode: on api_1 | * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) api_1 | * Restarting with stat api_1 | * Debugger is active! api_1 | * Debugger PIN: 221-047-422
はい。
もし、記事に沿って環境構築されている場合、まだ実装がないので、http://0.0.0.0:5000 にアクセスしても、エラーになりますので、ご注意ください。
実装
前置きが長くなりましたが、これでFlaskとMySQLが利用できるようになりましたので、実装を確認していきます。
run.py はFlaskアプリ起動用となります。
src/run.py
from src.app import app if __name__ == '__main__': app.run()
app.py でデータベース設定やAPIリソースのルーティング設定をしています。
Flask-RESTfulのadd_resource を利用することで、APIリソースの実装をapis に切り離すことができるのが良いところですね。
Flask-SQLAlchemyの利用方法については下記がとても参考になりました。感謝!
Flask + SQLAlchemyプロジェクトを始める手順 https://qiita.com/shirakiya/items/0114d51e9c189658002e
src/app.py
from flask import Flask, jsonify from flask_restful import Api from src.database import init_db from src.apis.hoge import HogeListAPI, HogeAPI def create_app(): app = Flask(__name__) app.config.from_object('src.config.Config') init_db(app) api = Api(app) api.add_resource(HogeListAPI, '/hoges') api.add_resource(HogeAPI, '/hoges/<id>') return app app = create_app()
app.py でインポートしているconfig.py はデータベースの接続文字列など、アプリケーションの設定情報の指定に利用しています。
src/config.py
import os class DevelopmentConfig: # SQLAlchemy SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://{user}:{password}@{host}/{database}?charset=utf8'.format( **{ 'user': os.getenv('DB_USER', 'root'), 'password': os.getenv('DB_PASSWORD', 'hoge'), 'host': os.getenv('DB_HOST', 'db'), 'database': os.getenv('DB_DATABASE', 'hoge'), }) SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ECHO = False Config = DevelopmentConfig
database.py ではデータベースを利用するための初期化処理やマイグレーション管理のために必要なメソッドを定義しています。
src/database.py
from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate db = SQLAlchemy() def init_db(app): db.init_app(app) Migrate(app, db)
APIリソースの実装
app.py で読み込んでいるAPIリソースの実装です。
下記記事が公式ドキュメントのサンプルをベースに詳しく説明してくれています。感謝!
Flask-RESTful – KZKY memo http://kzky.hatenablog.com/entry/2015/11/02/Flask-Restful
src/apis/hoge.py
from flask_restful import Resource, reqparse, abort from flask import jsonify from src.models.hoge import HogeModel, HogeSchema from src.database import db class HogeListAPI(Resource): def __init__(self): self.reqparse = reqparse.RequestParser() self.reqparse.add_argument('name', required=True) self.reqparse.add_argument('state', required=True) super(HogeListAPI, self).__init__() def get(self): results = HogeModel.query.all() jsonData = HogeSchema(many=True).dump(results).data return jsonify({'items': jsonData}) def post(self): args = self.reqparse.parse_args() hoge = HogeModel(args.name, args.state) db.session.add(hoge) db.session.commit() res = HogeSchema().dump(hoge).data return res, 201 class HogeAPI(Resource): def __init__(self): self.reqparse = reqparse.RequestParser() self.reqparse.add_argument('name') self.reqparse.add_argument('state') super(HogeAPI, self).__init__() def get(self, id): hoge = db.session.query(HogeModel).filter_by(id=id).first() if hoge is None: abort(404) res = HogeSchema().dump(hoge).data return res def put(self, id): hoge = db.session.query(HogeModel).filter_by(id=id).first() if hoge is None: abort(404) args = self.reqparse.parse_args() for name, value in args.items(): if value is not None: setattr(hoge, name, value) db.session.add(hoge) db.session.commit() return None, 204 def delete(self, id): hoge = db.session.query(HogeModel).filter_by(id=id).first() if hoge is not None: db.session.delete(hoge) db.session.commit() return None, 204
ポイント: 1リソース1クラスにできなさそう
hoges リソースに対して以下のようにHTTPメソッドを定義するとしたらHogeListAPI とHogeAPIクラスのように分ける必要があるっぽいです。個人的にはまとめてしまいたい感じです。
実装するHTTPメソッド
GET hoges
POST hoges
GET hoges/[id]
PUT hoges/[id]
DELETE hoges/[id]
Flask-RESTfulの実装
HogeListAPI
GET hoges: def get(self)
POST hoges: def post(self)
HogeAPI
GET hoges/[id]: def get(self, id)
PUT hoges/[id]: def put(self, id)
DELETE hoges/[id]: def delete(self, id)
ポイント: モデルはjsonify で返せない
以下のように取得した情報をjsonify でJSON形式にして返せたらシンプルなのですが、駄目なので、Flask-Marshmallowを利用してJSON形式に変換しています。
src/apis/hoge.py(だめな例)
def get(self, id): hoge = db.session.query(HogeModel).filter_by(id=id).first() if hoge == None: abort(404) return jsonify(hoge) # これだとだめ(´・ω・`)
Flask-Marshmallowについては下記の記事を参考にさせていただきました。感謝!
SQLAlchemy x marshmallowでModelからJSONへの変換を楽に行う https://techblog.recochoku.jp/3107
モデルの実装
Flask-SQLAlchemyを利用したモデルの実装になります。 APIリソースで利用、Flask-Migrateでマイグレーションする際に参照されます。
以下を記事を参考にして実装しました。感謝!
Flask + SQLAlchemyプロジェクトを始める手順 https://qiita.com/shirakiya/items/0114d51e9c189658002e
Flask-SQLAlchemyの使い方 https://qiita.com/msrks/items/673c083ca91f000d3ed1
SQLAlchemy x marshmallowでModelからJSONへの変換を楽に行う https://techblog.recochoku.jp/3107
SQLAlchemyでのupdate http://motomizuki.github.io/blog/2015/05/20/sqlalchemy_update_20150520/
id をUUIDにしてたり、created_at をcreateTime にしてたりしますが、そのへんはお好みで。
src/models/hoge.py
from datetime import datetime from flask_marshmallow import Marshmallow from flask_marshmallow.fields import fields from src.database import db import uuid ma = Marshmallow() class HogeModel(db.Model): __tablename__ = 'hoges' id = db.Column(UUIDType(binary=False), primary_key=True, default=uuid.uuid4) name = db.Column(db.String(255), nullable=False) state = db.Column(db.String(255), nullable=False) createTime = db.Column(db.DateTime, nullable=False, default=datetime.now) updateTime = db.Column(db.DateTime, nullable=False, default=datetime.now, onupdate=datetime.now) def __init__(self, name, state): self.name = name self.state = state def __repr__(self): return '<HogeModel {}:{}>'.format(self.id, self.name) class HogeSchema(ma.ModelSchema): class Meta: model = HogeModel createTime = fields.DateTime('%Y-%m-%dT%H:%M:%S') updateTime = fields.DateTime('%Y-%m-%dT%H:%M:%S')
マイグレーションする
マイグレーションに必要なファイルが準備できましたので、Flask-Migrateを利用して、データベースにテーブル追加してみます。
こちらも先程からなんども参考にしている下記が参考になります。
Flask + SQLAlchemyプロジェクトを始める手順 https://qiita.com/shirakiya/items/0114d51e9c189658002e#migration%E3%82%92%E8%A1%8C%E3%81%86%E3%81%AB%E3%81%AF
apiのコンテナに入って作業します。
> docker-compose exec api bash
flask db init コマンドでマイグレーションに必要となるファイルが作成されます。
コンテナ内
> flask db init Creating directory /src/migrations ... done Creating directory /src/migrations/versions ... done Generating /src/migrations/env.py ... done Generating /src/migrations/alembic.ini ... done Generating /src/migrations/script.py.mako ... done Generating /src/migrations/README ... done Please edit configuration/connection/logging settings in '/src/migrations/alembic.ini' before proceeding.
flask db migrate で“`
コンテナ内
> flask db migrate INFO [alembic.runtime.migration] Context impl MySQLImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.autogenerate.compare] Detected added table 'hoges' Generating /src/migrations/versions/a6e84088c8fe_.py ... done
コンテナ内
> flask db upgrade INFO [alembic.runtime.migration] Context impl MySQLImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade -> 244b6323079a, empty message
データベースにテーブルが追加されたか確認しています。
> docker-compose exec db mysql -u root -p
コンテナ内
mysql> use hoge; mysql> show tables; +-----------------+ | Tables_in_hoge | +-----------------+ | alembic_version | | hoges | +-----------------+ 2 rows in set (0.00 sec) mysql> desc hoges; +------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | id | varchar(255) | NO | PRI | NULL | | | name | varchar(255) | NO | | NULL | | | state | varchar(255) | NO | | NULL | | | createTime | datetime | NO | | NULL | | | updateTime | datetime | NO | | NULL | | +------------+--------------+------+-----+---------+-------+ 5 rows in set (0.10 sec)
マイグレーション管理用のalembic_version とhoges テーブルが作成されていたらおkです。
動作確認する
APIにアクセスしてみます。
> curl -X POST http://localhost:5000/hoges \ -H "Content-Type:application/json" \ -d "{\"name\":\"hoge\",\"state\":\"hoge\"}" { "updateTime": "2018-10-13T10:16:06", "id": "3a401c04-44ff-4d0c-a46e-ee4b9454d872", "state": "hoge", "name": "hoge", "createTime": "2018-10-13T10:16:06" } > curl -X PUT http://localhost:5000/hoges/3a401c04-44ff-4d0c-a46e-ee4b9454d872 \ -H "Content-Type:application/json" \ -d "{\"name\":\"hogehoge\"}" > curl http://localhost:5000/hoges/3a401c04-44ff-4d0c-a46e-ee4b9454d872 { "id": "3a401c04-44ff-4d0c-a46e-ee4b9454d872", "createTime": "2018-10-13T10:16:06", "state": "hoge", "updateTime": "2018-10-13T10:19:23", "name": "hogehoge" } > curl http://localhost:5000/hoges { "items": [ { "createTime": "2018-10-13T10:16:06", "id": "3a401c04-44ff-4d0c-a46e-ee4b9454d872", "name": "hogehoge", "state": "hoge", "updateTime": "2018-10-13T10:19:23" } ] }
DELETE する前にテーブルの中身をみておきます。
> docker-compose exec db mysql -u root -p Enter password: mysql> use hoge; mysql> select * from hoges; +--------------------------------------+----------+-------+---------------------+---------------------+ | id | name | state | createTime | updateTime | +--------------------------------------+----------+-------+---------------------+---------------------+ | 3a401c04-44ff-4d0c-a46e-ee4b9454d872 | hogehoge | hoge | 2018-10-13 10:16:06 | 2018-10-13 10:19:23 | +--------------------------------------+----------+-------+---------------------+---------------------+ 1 row in set (0.00 sec) mysql> quit
ではDELETEしてみます。
> curl -X DELETE http://localhost:5000/hoges/3a401c04-44ff-4d0c-a46e-ee4b9454d872 > curl http://localhost:5000/hoges/3a401c04-44ff-4d0c-a46e-ee4b9454d872 { "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again." }
はい。一通りのAPIがうまく機能していることが確認できました。
まとめ
FlaskでDBを利用するRESTfulなAPIを実装する場合、モジュールを利用すると、いい感じに実装できるものの、利用するモジュールが増えて、学習コストがそこそこ掛かりそうです。
次は別の記事で単体テストを追加してみます。
元記事はこちら
「PythonのFlaskでMySQLを利用したRESTfulなAPIをDocker環境で実装する」
October 31, 2018 at 12:00PM
1 note · View note
secretcrownchild · 4 years ago
Text
Macos Operating System Used For
Tumblr media
File system formats available in Disk Utility on Mac. Disk Utility on Mac supports several file system formats: Apple File System (APFS): The file system used by macOS 10.13 or later. Mac OS Extended: The file system used by macOS 10.12 or earlier. MS-DOS (FAT) and ExFAT: File systems that are compatible with Windows. Open Disk Utility for me.
17 rows  May 26, 2020  If your Mac is using an earlier version of any Mac operating system, you should install the latest Apple software updates, which can include important security updates and updates for the apps installed by macOS, such as Safari, Books, Messages, Mail, Music, Calendar, and Photos.
Macos Operating System Used For Sale
Easily check which versions of mac OS, iOS, iPadOS, or watchOS are compatible with your Mac model or iDevice. Guide includes OS X 10.8.x to macOS 11.0.x. Feb 11, 2017  The 'System' category appears to be including sandboxed application data, which is stored in /Library/Containers/. I used About This Mac Storage Review Files File Browser to navigate to the folders/files using the most space and found that Docker was growing a file called Docker.qcow2 indefinitely in /Library/Containers/. Deleting the file released 30GB from 'System' while 'Documents. The macOS High Sierra is the newer version of Apple’s operating system which is still vastly used and loved by users. MacOS High Sierra was launched and put out back in 2017 WWDC. But even with the newer versions, there are still lots of users who wants to install High Sierra. It’s why there’s nothing else like a Mac. MacOS is the operating system that powers every Mac. It lets you do things you simply can’t with other computers. That’s because it’s designed specifically for the hardware it runs on — and vice versa. MacOS comes with an entire suite of beautifully designed apps. The operating system was programmed up to system 6.0 mostly in assembler and partially in Pascal and used a 24-bit addressing mode. Cooperative Multi-tasking could optionally be enabled in System 6. System 7.0 first supported 32-bit addressing. Thus allow the operating system can use more memory and more powerful programs.
Tumblr media
macOS is the operating system that powers every Mac. It lets you do things you simply can’t with other computers. That’s because it’s designed specifically for the hardware it runs on — and vice versa. macOS comes with an entire suite of beautifully designed apps. It works hand in hand with iCloud to keep photos, documents, and other stuff up to date on all your devices. It makes your Mac work like magic with your iPhone and other Apple devices. And it’s been built from the ground up with privacy and security in mind.
Featuring all-new, dedicated apps for music, TV, and podcasts. Smart new features in the apps you use every day. And Sidecar, which lets you use iPad as a second Mac display.
Easy to Use When it’s simple to do everything, you can do anything.
On a Mac, everything is designed to work just the way you expect it to — from operating it with simple, intuitive gestures to having your apps automatically update themselves. Whatever you set out to do on a Mac, there’s much less to learn and that much more to accomplish.
The Finder lets you easily browse and organize the files on your Mac — and those stored in iCloud Drive. View files by icons, in a list, or with Gallery View, which helps you quickly locate a file by how it looks. Drag and drop files into folders in the sidebar. And use the Preview pane to see all of your files’ metadata, quickly create .zip files, and share using the handy Share menu.
Dark Mode adds a dramatic look to your desktop and apps that puts the focus on your content. Dynamic Desktop makes your Mac even more beautiful with time-shifting desktop pictures that match the time of day wherever you are. And Stacks keeps your desktop free of clutter by automatically organizing your files, images, documents, PDFs, and more into tidy groups.
Spotlight helps you quickly and effortlessly find what you want, like documents on your Mac, movie showtimes, and flight departure and arrival times. Just type a few keystrokes in the Spotlight search field and autocomplete immediately shows you relevant results.1
A simple two-finger swipe from the right edge of your trackpad brings up Notification Center — the same one you use on iPhone — where you can see all the alerts that have come in recently. It’s also where you’ll find your Today view, which you can customize with helpful widgets or handy information pinned from Siri searches.
Continuity All your devices. One seamless experience.
Your Mac works with your other Apple devices in ways no other computer can. If you get a call on your iPhone, you can take it on your Mac. And when friends text you — regardless of the phone they have — you can respond from your Mac, iPad, or iPhone, whichever is closest. When you copy text or an image from one device, you can paste it into another with standard copy and paste commands. And with Sidecar, you can extend your workspace by using your iPad as a second Mac display. You can even unlock your Mac with your Apple Watch. No password typing required.
Privacy and Security We believe your data belongs to you. Period.
Everything you do with your Mac is protected by strong privacy and security features. That’s because we build data security into everything we make, right from the start.
Privacy. You trust our products with your most personal information, and we believe that you should be in complete control of it. We respect your privacy by enacting strict policies that govern how all data is handled. And when you browse the web, Safari helps prevent data companies from tracking the sites you visit.
Security. We design Mac hardware and software with advanced technologies that work together to help you run apps safely, protect your data, and keep you safe on the web. The new Find My app helps you locate a missing Mac that’s lost or stolen — even if it’s offline or sleeping. And Gatekeeper makes it safer to download and install apps from the Mac App Store and the internet.
Built in Apps Apps as powerful and elegant as your Mac. Because they’re designed for it.
With every Mac, you get a collection of powerful apps. They’re the same apps you use on your iPhone or iPad, so they’ll feel instantly familiar. They all work with iCloud, so your schedule, contacts, and notes are always up to date everywhere. And because they’re native apps — not web apps in a browser — they take full advantage of the power of your Mac to deliver the fastest possible performance and more robust features.
Media. Experience music, TV, and podcasts in three all-new Mac apps. Track the market and customize your watchlist. Peruse the best book titles from your desktop. And find the latest apps and extensions for your Mac, right on your Mac.
Podcasts
Stocks
App Store
Creativity. Enjoy your best photos and videos, showcased in an immersive, dynamic new look. Transform home videos into unforgettable movies or quickly share clips with your favorite people. Create music like the pros with a huge collection of sounds, instruments, amps, and a lineup of virtual session drummers and percussionists perfectly suited to play along with your song.
Productivity. Create beautiful documents with stunning simplicity. Visualize your data precisely and persuasively in spreadsheets with images, text, and shapes. Make stage-worthy presentations using powerful graphics tools and dazzling cinematic effects to bring your ideas to life. And collaborate with friends and coworkers in real time — whether they’re across town or across the globe.
Communication. Easily manage all of your email accounts in one simple, powerful app that works with email services like iCloud, Gmail, Yahoo, AOL, and Microsoft Exchange. Send unlimited messages to anyone on any Apple device, using the same Messages app on your Mac as you do on your iPhone. Make unlimited high-quality video and audio calls right from your Mac with FaceTime. And securely locate a missing Mac using the new Find My app on Mac, iPhone, and iPad.
Mail
Messages
FaceTime
Organization. A new gallery view and more powerful search help you find your notes more quickly than ever. Easily create, organize, and add attachments to reminders. Manage your iCloud, Google, and Exchange calendars in one place, create separate calendars for home, work, and school, and view them all or just the ones you want. Instantly capture personal reminders, class lectures, even interviews or song ideas with Voice Memos. Keep all your contact info up to date on all your devices, and easily import numbers, addresses, and photos from Google and Microsoft Exchange. And control all your HomeKit-enabled accessories from the comfort of your desktop.
Notes
Reminders
Calendar
Voice Memos
Contacts
Internet. Surf the web seamlessly with an updated start page that helps you quickly access your favorite and frequently visited sites. Map out new destinations from your desktop, with gorgeous 3D city views like Flyover, point-to-point directions, and comprehensive transit directions. And instantly search your entire Mac or get results from the internet in just a few keystrokes.
iCloud All your stuff. On your Mac, and everywhere else you want it. Automatically.
Every Apple app uses iCloud — it’s the magic behind the seamless experience you have with all your Apple devices. So you always have your photos, videos, documents, email, notes, contacts, calendars, and more on whatever device you’re using. And any file you store in iCloud Drive can be shared with friends, family, and colleagues just by sending them a link. iCloud Drive also lets you access files from your Mac desktop and Documents folder on any iOS device. It’s all done automatically. Just like that.2
Accessibility We make sure that everyone is able to use a Mac.
macOS comes standard with a wide range of assistive technologies that help people with disabilities experience what the Mac has to offer, providing many features you won’t find in other operating systems. Features such as VoiceOver, Accessibility Keyboard, FaceTime,3 and Text to Speech help everyone get more out of Mac.
What Is Mac Os Operating System
Tumblr media
Technology Advanced to the core.
macOS features powerful core technologies engineered for the most important functions of your Mac. Thanks to Mac Catalyst, you can now enjoy your favorite iPad apps on your Mac. With SwiftUI, developers have a simple way to build better apps across all Apple platforms with less code. Create ML gives developers a faster and easier way to build machine learning into apps. And support for virtual and augmented reality lets developers create immersive worlds for you to step into.
Compatibility Need to work with Windows? Mac does that, too.
Disk Formatting
With macOS, it’s easy to transfer your files, photos, and other data from a Windows PC to your Mac. Work with popular file types such as JPEG, MP3, and PDF, as well as Microsoft Word, Excel, and PowerPoint documents. And, of course, you can run Microsoft Office natively on a Mac. If you want, you can even run Windows on your Mac.4
Tumblr media
0 notes
computersystemsdesign · 8 years ago
Text
You Need Configuration Management. Really.
It sounds obvious, perhaps, but without configurations, our network, compute, and storage environments won't do very much for us. Configurations develop over time as we add new equipment, change architectures, improve our standards, and deploy new technologies. The sum of knowledge within a given configuration is quite high. Despite that, many companies still don't have any kind of configuration management in place, so in this article, I will outline some reasons why configuration management is a must, and look at a some of the benefits that come with having it.
 Recovery from total loss
As THWACK users, I think we're all pretty technically savvy, yet if I were to ask right now if you had an up-to-date backup of your computer and its critical data, what would the answer be? If your laptop's hard drive died right now, how much data would be lost after you replaced it?
 Our infrastructure devices are no different. Every now and then a device will die without warning, and the replacement hardware will need to have the same configuration that the (now dead) old device had. Where's that configuration coming from?
 Total loss is perhaps the most obvious reason to have a system of configuration backups in place. Configuration management is an insurance policy against the worst eventuality, and it's something we should all have in place. Potential ways to achieve this include:
 Manual periodic configuration backups/exports
Scheduled expect scripts grabbing configurations
RANCID
SolarwindsNetwork Configuration Manager (of course!)
 At a minimum, having the current configuration safely stored on another system is of value. Some related thoughts on this:
 Make sure you can get to the backup system when a device has failed.
Back up / mirror / help ensure redundancy of your backup system.
If "rolling your own scripts," make sure that, say, a failed login attempt doesn't overwrite a valid configuration file (he said, speaking from experience). In other words, some basic validation is required to make sure that the script output is actually a configuration file and not an error message.
 Archives
Better than a copy of the current configurations, a configuration archive tracks all -- or some number of -- the previous configurations for a device.
 An archive gives us the ability to see what changes occurred to the configuration and when. If a device doesn't support configuration rollback natively, it may be possible to create a kind of rollback script based on the difference between the two latest configurations. If the configuration management tool (or other systems) can react to SNMP traps to indicate a configuration change, the archive can be kept very current by triggering a grab of the configuration as soon as a change is noted.
 Further, home-grown scripts or configuration management products can easily identify device changes and generate notifications and alerts when changes occur. This can provide an early warning of unauthorized configurations or changes made outside scheduled maintenance windows.
 Compliance / Audit
Internal Memo
We need confirmation that all your devices are sending their syslogs to these seventeen IP addresses.
 -- love from, Your Friendly Internal Security Group xxx
"Putting the 'no' in Innovation since 2003"
 A request like this can be approached in a couple of different ways. Without configuration management, it's necessary to log in to each device and check the syslog server configuration. With a collection of stored configurations, however, checking this becomes a matter of processing configurations files. Even grepping them could extract the necessary information. I've written my own tools to do the same thing, using configuration templates to allow support for the varying configuration stanzas used by different flavors of vendor and OS to achieve the same thing.
 Some tools — Solarwinds NCM is one of them — can also compare the latest configuration against a configuration snippet and report back on compliance. This kind of capability makes configuration audits extremely simple.
 Even without a security group making requests, the ability to audit configurations against defined standards is an important capability to have. Having discussed the importance of configuration consistency, it seems like a no-brainer to want a tool of some sort to help ensure that the carefully crafted standards have been applied everywhere.
 Pushing configuration to devices
I'm never quite sure whether the ability to issue configuration commands to devices falls under automation or configuration management, but I'll mention it briefly here since NCM includes this capability. I believe I've said in a previous Geek Speak post that it's abstractions that are most useful to most of us. I don't want to write the code to log into a device and deal with all the different prompts and error conditions. Instead, I'd much rather hand off to a tool that somebody else wrote and say, Send this. Lemme know how it goes. If you have the ability to do that and you aren't the one who has to support it, take that as a win. And while you're enjoying the golden trophy, give some consideration to my next point.
 Where is your one true configuration source?
Why do we fall into the trap of using hardware devices as the definitive source of each configuration? Bearing in mind that most of us claim that we're working toward building a software-defined network of some sort, it does seem odd that the configuration sits on the device. Why does it not sit in a database or other managed repository that has been programmed based on the latest approved configuration in that repo?
 Picture this for example:
 Configurations are stored in a git repo
Network engineers fork the repo so they have a local copy
When a change is required, the engineer makes the necessary changes to their fork, then issues a pull request back to the main repo.
Pull requests can be reviewed as part of the Change Control process, and if approved, the pull-request is accepted and merged into the configuration.
The repo update triggers the changes to be propagated to the end device
 Such a process would give us a configuration archive with a complete (and commented) audit trail for each change made. Additionally, if the device fails, the latest configuration is in the git repo, not on the device, so by definition, it's available for use when setting up the replacement device. If you're really on the ball, it may be possible to do some form of integration testing/syntax validation of the change prior to accepting the pull request.
 There are some gotchas with this, not the least of which is that going from a configuration diff to something you can safely deploy on a device may not be as straightforward as it first appears. That said, thanks to commands like Junos' load replace and load override and IOS XR's commit replace, such things are made a little easier.
 The point of this is not really to get into the implementation details, but more to raise the question of how we think about network device configurations in particular. Compute teams get it; using tools like Puppet and Chef to build and maintain the state of a server OS, it's possible to rebuild an identical server. The same applies to building images in Docker. The configuration should not be within the image becuase it's housed in the Dockerfile. So why not network devices, too? I'm sure you'll tell me, and I welcome it.
 Get. Configuration. Management. Don't risk being the person everybody feels pity for after their hard drive crashes.
The post You Need Configuration Management. Really. appeared first on Computer Systems Design.
from Computer Systems Design http://ift.tt/2vG7s8t
0 notes