Skip to content

Instantly share code, notes, and snippets.

Instruction to install ORAS

Download the releases from here https://github.com/deislabs/oras/releases

Linux

curl -sLO  https://github.com/deislabs/oras/releases/download/v0.7.0/oras_0.7.0_linux_amd64.tar.gz && \
tar -xvzf oras_0.7.0_linux_amd64.tar.gz && \
sudo cp ./oras /usr/local/bin/

Singularity Images in an OCI Registry

The proposal is to enable singularity to be able to push and pull images from an OCI compatible registry. Azure Container Registry an AWS's ECR already support the OCI specification. This is based off - https://github.com/stevelasker/registryArtifactTypes/

If we have native support for SIF as OCI then the experience could be something like this

# Creates a manifest and moves the file to a cache or location that singularity is comfortable with. 
singularity build oci://hpccontainers.azurecr.io/singularity:centos -f ./layer_centos.sif 
@sajayantony
sajayantony / check-acr.md
Last active April 20, 2019 01:45
ACR-Diagnostics

ACR Diagnostics

The basic idea here is to enable customer to self diagnose and give us some data.

  • Validate DNS query works through docker.
  • Potentially provide and image that they can run so that the script is actually run inside a docker environment rather than on the host itself.
  • Give a way for them to report back the correlation ID.
  • Run a token service command
  • Run a dataplane command like a test upload a 0 byte blob with a correlation id.
#!/bin/sh
docker pull hello-world:latest
export REPO=myregistry.azurecr.io/hello-world
docker tag hello-world:latest $REPO:latest
docker push $REPO:latest
for i in `seq 1 200`; do
docker tag hello-world:latest $REPO:$i
docker push $REPO:$i
done
@sajayantony
sajayantony / main.go
Last active August 14, 2018 02:10
YAML always as string
package main
import (
"fmt"
"log"
"strings"
"gopkg.in/yaml.v2"
)
@sajayantony
sajayantony / role-assignment-arm.md
Created August 7, 2018 00:35
Role-Assignment for ACR
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "containerRegistry": {
      "type": "string"
    },
    "sourceResourceId": {
      "type": "string"
@sajayantony
sajayantony / README.md
Last active August 6, 2018 07:07
Install Docker Specific version of Docker

Using Docker for validating different versions of docker

For this it's usually easier to run docker as a privileged container and install binaries into it.

docker pull ubuntu
docker run --rm -it --privileged

Install Docker from binaries.

@sajayantony
sajayantony / README.MD
Created August 2, 2018 17:24
Images sizes explained
❯ docker pull ubuntu && docker images | grep ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
Digest: sha256:3f119dc0737f57f704ebecac8a6d8477b0f6ca1ca0332c7ee1395ed2c6a82be7
Status: Image is up to date for ubuntu:latest
ubuntu                            latest              735f80812f90        6 days ago          83.5MB
ubuntu                            <none>              74f8760a2a8b        2 weeks ago         82.4MB
                                                                                                                                                                                                                     10:20:37  sajay
❯ docker manifest inspect ubuntu   | jq '.manifests[] |  select(.platform.os=="linux" and .platform.architecture=="amd64") | .digest '
@sajayantony
sajayantony / acr-swagger.yml
Created September 2, 2017 00:02
Azure Container Registry - Swagger
swagger: '2.0'
# Document metadata
info:
version: "1.0"
title: "Azure Container Registry"
description: "V2 API definition for the Docker Registry"
host: "sajaypreview.azurecr.io"
schemes:
@sajayantony
sajayantony / ConfigManager.cs
Created May 23, 2017 01:52
Symver based ConfigManager
void Main()
{
var configs = new List<ConfigValue>()
{
new ConfigValue { Key = "A", Type = typeof(string), Value = "oldValueForA", Version = new Version(1, 0) } ,
new ConfigValue { Key = "A", Type = typeof(string), Value = "newValueForA", Version = new Version(1, 1) } ,
new ConfigValue { Key = "B", Type = typeof(string), Value = "somevalueforB", Version = new Version(1, 1) }
};
GetConfigs(new Version(1,0), configs).Dump();