Pá. Dub 19th, 2024
spuštění příkazu cog na ubuntu-server 22.04 LTS

Proč ubuntu 22.04 LTS? Má to long-term support na 5 let, ubuntu-server image používá velmi hojně Microsoft Azure cloud, Google Cloud platform, Amazon Web Services.
Přihlašte se za obyčejného uživatele, nesmíte být za roota, jinak to nefunguje, nebo bude řvát, že za roota byste to neměli pouštět.

Brew je jednou větou vcelku užitečný příkaz, který vám umožňuje instalovat různé balíčky nenacházející se ve standardních repozitářích, jako je k9s pro správu kubernetes, nebo cog, kontejnerizační platforma na strojové učení (machine learning).

#!/bin/bash
apt install build-essential git curl -y
user=$(whoami)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/$user/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Po spuštění skriptu už vám budou fungovat brew příkazy. Ověříte příkazem:

brew doctor

který vypíše:
Your system is ready to brew.

Instalace Cog přes brew

brew install cog

brew install cog
==> Fetching dependencies for cog: ca-certificates, openssl@1.1 and redis
==> Fetching ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023-01-10
########################################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:11fe9d0a98a2ac454fa1db95762a697c3340f46560ff27e5e9db8fdeb003f17e
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:11fe9d0a98a2ac454fa1db95762a697c3340f46560ff27e5e9db8fdeb003
########################################################################################################################################## 100.0%
==> Fetching openssl@1.1
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1t
########################################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:8844b2e735dd6e8bc1395eda1a123c136f90cb8985fcec6a7ae6815b5aad971b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:8844b2e735dd6e8bc1395eda1a123c136f90cb8985fcec6a7ae6815b5aad
########################################################################################################################################## 100.0%
==> Fetching redis
==> Downloading https://ghcr.io/v2/homebrew/core/redis/manifests/7.0.11
########################################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/redis/blobs/sha256:a54eeb6cfe5062a0ed47568b59b9fe2bcb23b3328389b7d72e8f2fefb960c7d5
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a54eeb6cfe5062a0ed47568b59b9fe2bcb23b3328389b7d72e8f2fefb960
########################################################################################################################################## 100.0%
==> Fetching cog
==> Downloading https://ghcr.io/v2/homebrew/core/cog/manifests/0.7.1
########################################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/cog/blobs/sha256:b97fd3ac62dc7c9742556fc33b7bca75372492e60b1c6bf754e3cce42901c617
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:b97fd3ac62dc7c9742556fc33b7bca75372492e60b1c6bf754e3cce42901
########################################################################################################################################## 100.0%
==> Installing dependencies for cog: ca-certificates, openssl@1.1 and redis
==> Installing cog dependency: ca-certificates
==> Pouring ca-certificates--2023-01-10.all.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/ca-certificates/2023-01-10: 3 files, 232.5KB
==> Installing cog dependency: openssl@1.1
==> Pouring openssl@1.1--1.1.1t.x86_64_linux.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/openssl@1.1/1.1.1t: 8,409 files, 24.4MB
==> Installing cog dependency: redis
==> Pouring redis--7.0.11.x86_64_linux.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/redis/7.0.11: 14 files, 5.9MB
==> Installing cog
==> Pouring cog--0.7.1.x86_64_linux.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /home/linuxbrew/.linuxbrew/etc/bash_completion.d
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/cog/0.7.1: 8 files, 10.3MB
==> Running `brew cleanup cog`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> cog
Bash completion has been installed to:
  /home/linuxbrew/.linuxbrew/etc/bash_completion.d


Vyzkoušíme, že cog je nainstalován


$ cog
Containers for machine learning.

To get started, take a look at the documentation:
https://github.com/replicate/cog

Usage:
  cog [command]

Examples:
   To run a command inside a Docker environment defined with Cog:
      $ cog run echo hello world

Available Commands:
  build       Build an image from cog.yaml
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  init        Configure your project for use with Cog
  login       Log in to Replicate Docker registry
  predict     Run a prediction
  push        Build and push model in current directory to a Docker registry
  run         Run a command inside a Docker environment

Flags:
      --debug     Show debugging output
  -h, --help      help for cog
      --version   Show version of Cog

Use "cog [command] --help" for more information about a command.


zdroj zdroj2 zdroj3

Všechno špatně, aneb apt install cog -y

apt install cog -y

Vás dovede v den psaní článku k verzi 0.12.1, zatímco přes brew, jsem dostal verzi 0.7.1.

Avatar

By mirra

Hardwaru a počítačům se věnuji již od roku 2003. Za tu dobu jsem poskládal stovky počítačů, opravil tisíce počítačů a vyřešil nespočetně problémů, vad a chyb, se kterými se setkávali uživatelé. Od roku 2005 se zabývám servery, zejména těmi herními, v roce 2007 jsem se začal věnovat Valve Source SDK level designu, který šel od roku 2009 k ledu kvůli studiu Informatiky na univerzitě. Podílel jsem se chvíli i na provozu síťové laboratoře MENDELU, dnes spravuji cca 30 serverů/diskových polí na univerzitě, řeším IT v malých a středních firmách tak, aby firmy ušetřily nemalé částky při zlepšení kvality a soustředím se na snižování nákladů na IT od licencí až po hardware, software, provádím konsolidace a audity platnosti licencí, které firmám šetří rovněž nemalé peníze. Z velkých firem spravuji s dalšími kolegy 8000 serverů po celé Evropě a tato práce mě nesmírně baví, protože se vše musí automatizovat a nabízí mi to možnost trénovat další evropské jazyky od Angličtiny, přes Němčinu až po Italštinu.

Napsat komentář

Vaše e-mailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *

4 × 3 =