Editor Lite image

Aperta
#74 10 commenti 12 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, unity

Direzione di ricerca

Inizia con il Dockerfile incluso nell’issue e confronta il suo builder stage con la definizione attuale dell’immagine Unity Editor. Crea l’immagine ridotta, quindi esegui il workflow di test di Unity per verificare i template, i pacchetti, gli SDK, i file di debugging e i motori di playback rimossi rispetto alle esigenze del progetto. Il lavoro è completato quando l’immagine è più piccola senza interrompere gli scenari CI supportati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Description
Some time ago I've started to investigate can the image be smaller. I've managed to reduce image size three times (from 3 GB to 1 GB). The reasoning behind my research was that the private GitHub repo has a limited amount of action execution minutes. And seems like downloading the docker image is a significant part of the run tests action. By decreasing the size of the image, we reduced the time of the unity-test-runner from 5.0 mins to 2.3 mins.

image
image

But since I'm not interested in fighting around pull requests to this repo and do not have time to test all the limitations & edge cases I want just to share with you the dockerfile to let the community decide is it feasible to take some of my findings and cut them out from the official image.

Dockerfile:

ARG baseImage=unityci/base:latest
ARG editorImage=unityci/editor:2020.2.1f1-base-0

FROM $editorImage as builder

# Templates
RUN echo 'Cleaning image' \
# Remove templates
    && rm -rf /opt/unity/Editor/Data/Resources/PackageManager/ProjectTemplates/ \
    && rm -rf /opt/unity/Editor/Data/Resources/PackageManager/PackageTemplates/ \
# Remove everything except manifest from packages
    && find /opt/unity/Editor/Data/Resources/PackageManager/Editor/ \
          ! -name 'manifest.json' \
          -type f -exec rm -f {} + \
# Remove unnecessary Mono resources
    && rm -rf /opt/unity/Editor/Data/MonoBleedingEdge/lib/mono/monodoc/ \
    && rm -rf /opt/unity/Editor/Data/MonoBleedingEdge/bin-linux32 \
# SDK is not required for .NET Core
    && rm -rf /opt/unity/Editor/Data/NetCore/Sdk-* \
# We are not planning to debug in CI
    && rm -rf /opt/unity/Editor/Unity_s.debug \
# Remove playback engines
    && rm -rf /opt/unity/Editor/Data/PlaybackEngines/

###########################
#          Editor         #
###########################

FROM $baseImage

# Always put "Editor" and "modules.json" directly in $UNITY_PATH
ARG UNITY_PATH=/opt/unity
COPY --from=builder "$UNITY_PATH/" "$UNITY_PATH/"

# Alias to "unity-editor" with default params
RUN echo '#!/bin/bash\nxvfb-run -ae /dev/stdout "$UNITY_PATH/Editor/Unity" -batchmode "$@"' > /usr/bin/unity-editor \
 && chmod +x /usr/bin/unity-editor
Lingua principale
Dockerfile
Stelle
471
Fork
141
Merge medio
6g 1h
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di game-ci/docker

Tutte le issue di game-ci/docker

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.