Kubernetes 1.32ã§ã¡ã¢ãªããã¼ã¸ã£ãæ£å¼çã¨ãªã£ããã¨ãçºè¡¨ããã¾ãããããã«ãããNUMAãµã¼ãä¸ã§ã³ã³ããåãããã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ã¡ã¢ãªå²ãå½ã¦ãæé©åãããã¨ã«ããæ§è½åä¸ãªã©ãæå¾ ã§ãã¾ãã
⧠ä½ãããå ã«ãKubernetesãã¯æ°è»½ã«ç°å¢æ§ç¯ã§ããããã«ãã¦æ¬²ããã®ãã...
ãã¼ã«ã«ç°å¢ã ã¨ããã·ã³ã®ã¹ããã¯ã®åé¡ã§ãã¯ã©ã¹ã¿ã¼æ§æã®æ§ç¯ãé£ããããã¯ã©ã¦ãç°å¢ã¯èª²éãæãã¦è©¦ããªã...
GitHub Actionsããã¼ã«ã«ã§å®è¡ã§ããnektos/actãå°å ¥ã®ããã«ãDockerãã¤ã³ã¹ãã¼ã«ãã
ååãnektos/actãã®è©±ã§ããLinuxãç°å¢ã«å°å ¥ããããã®è¦ä»¶ã¨ãã¦ããnektos/actããæå®ãããLinux ãã£ã¹ããªãã¥ã¼ã·ã§ã³ããç¨æããå¿ è¦ãããããArchLinuxãç°å¢ãæ§ç¯ãã¾ããã
⧠ä¸è¨ã§ã¯ãArchLinuxãç°å¢ã¾ã§ããæ´ã£ã¦ããªãã®ã§ããDockerãããGitããªã©ãã¤ã³ã¹ãã¼ã«ãã¦ããå¿ è¦ãããã¾ãã¨ã
ã¾ãã¯ããnektos/actãã¯ããDocker Engine APIããå©ç¨ã§ããç°å¢ãMUSTãªè¦ä»¶ã®ããããArchLinuxãç°å¢ã«ãDockerããã¤ã³ã¹ãã¼ã«ãã¾ãã
â§ å ¬å¼ã®æé ã¨ã
â§ãWSL 2ï¼Windows Subsystem for Linux 2ï¼ãã«ãimportããã¦ãLinux ãã£ã¹ããªãã¥ã¼ã·ã§ã³ããã¤ã³ã¹ãã¼ã«ããå ´åã®ç¹æã®åé¡ã«å¯¾å¿ããå¿ è¦ãããã泥沼ã«ããã...
ããããããArchLinuxãã®ããã±ã¼ã¸ç®¡çãã¼ã«ãpacmanããå©ç¨ã§ããããã«ãªã£ã¦ããªãã£ãã®ã§ããpacmanããå©ç¨ã§ããããã«ãã¦ããDockerããã¤ã³ã¹ãã¼ã«ããã
ã§ããWSL 2ï¼Windows Subsystem for Linux 2ï¼ãã§ãsystemdããå©ç¨ã§ããããã«ãã/etc/wsl.confããä½æãã以ä¸ã®è¨å®ãè¨è¼ã
ãWSL 2ï¼Windows Subsystem for Linux 2ï¼ãã®ãArchLinuxãç°å¢ãããã°ã¢ã¦ãããåèµ·åã
åèµ·åå¾ããsystemdããå©ç¨ã§ããããã«ãªãã®ã§ããWSL 2ï¼Windows Subsystem for Linux 2ï¼ãã«ãimportããã¦ãLinux ãã£ã¹ããªãã¥ã¼ã·ã§ã³ããã¤ã³ã¹ãã¼ã«ããå ´åã®ç¹æã®åé¡ã®å¯¾å¿ãæ¸ã¾ãã¦ããã
ã§ãããä¸åº¦ãåèµ·åããã¨ããDockerãã®ãµã¼ãã¹ãæå¹ã«ãªã£ã¦ãã¦ãDockerããå©ç¨ã§ããããã«ãªã£ã¦ãããã¨ã確èªã§ããã¯ãã
å¥éããsudoããOpenSSHãã¨ããã¤ã³ã¹ãã¼ã«ãã¦ã¾ãã
ã¦ã¼ã¶ã¼ã追å ã
sudoãå©ç¨ã§ããããã«ãã¦ããã
â§ã%wheel ALL=(ALL:ALL) ALLãã®ã³ã¡ã³ãã¢ã¦ããå¤ãã¦ããã
ã¨ããããããGitãªãã¸ããªãããã¼ã«ã«ç°å¢ã«å¿ è¦ã£ã½ãã®ã§ãgit cloneãå®è¡ã§ããããã«ãGitããã¤ã³ã¹ãã¼ã«ãã¦ããã
GitHub Actionsããã¼ã«ã«ã§å®è¡ã§ããnektos/actãå°å ¥ãã¦ã¿ã
ãããã£ã¨ããnektos/actããå©ç¨ããããã®è¦ä»¶ãæ´ã£ãã®ã§ããnektos/actããã¤ã³ã¹ãã¼ã«ãã¾ãã
sudo pacman -Syu act
ã¤ã³ã¹ãã¼ã«ãããã®ããåããè¾ãã®ã ãããpacman -Qãã§ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ããã±ã¼ã¸ä¸è¦§ã表示ããã¨ãããä¸å¿ãã¤ã³ã¹ãã¼ã«ããã¦ã¯ãããã
ã¨ããããããnektos/actãã®ä»çµã¿ãåãããªéããã®ã§ãããã«ããã確èªãã¦ã¿ãã
[ts0818@Toshinobu-PC ~]$ act -h Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly. Usage: act [event name to run] [flags] If no event name passed, will default to "on: push" If actions handles only one event it will be used as default instead of "on: push" Flags: --action-cache-path string Defines the path where the actions get cached and host workspaces created. (default "/home/ts0818/.cache/act") --action-offline-mode If action contents exists, it will not be fetch and pull again. If turn on this,will turn off force pull -a, --actor string user that triggered the event (default "nektos/act") --artifact-server-addr string Defines the address to which the artifact server binds. (default "172.24.91.141") --artifact-server-path string Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start. --artifact-server-port string Defines the port where the artifact server listens. (default "34567") -b, --bind bind working directory to container, rather than copy --bug-report Display system information for bug report --cache-server-addr string Defines the address to which the cache server binds. (default "172.24.91.141") --cache-server-path string Defines the path where the cache server stores caches. (default "/home/ts0818/.cache/actcache") --cache-server-port uint16 Defines the port where the artifact server listens. 0 means a randomly available port. --container-architecture string Architecture which should be used to run containers, e.g.: linux/amd64. If not specified, will use host default architecture. Requires Docker server API Version 1.41+. Ignored on earlier Docker server platforms. --container-cap-add stringArray kernel capabilities to add to the workflow containers (e.g. --container-cap-add SYS_PTRACE) --container-cap-drop stringArray kernel capabilities to remove from the workflow containers (e.g. --container-cap-drop SYS_PTRACE) --container-daemon-socket string URI to Docker Engine socket (e.g.: unix://~/.docker/run/docker.sock or - to disable bind mounting the socket) --container-options string Custom docker container options for the job container without an options property in the job definition --defaultbranch string the name of the main branch --detect-event Use first event type from workflow as event that triggered the workflow -C, --directory string working directory (default ".") -n, --dryrun disable container creation, validates only workflow correctness --env stringArray env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv) --env-file string environment file to read and use as env in the containers (default ".env") -e, --eventpath string path to event JSON file --github-instance string GitHub instance to use. Only use this when using GitHub Enterprise Server. (default "github.com") -g, --graph draw workflows -h, --help help for act --input stringArray action input to make available to actions (e.g. --input myinput=foo) --input-file string input file to read and use as action input (default ".input") --insecure-secrets NOT RECOMMENDED! Doesn't hide secrets while printing logs. -j, --job string run a specific job ID --json Output logs in json format -l, --list list workflows --local-repository stringArray Replaces the specified repository and ref with a local folder (e.g. https://github.com/test/test@v0=/home/act/test or test/test@v0=/home/act/test, the latter matches any hosts or protocols) --log-prefix-job-id Output the job id within non-json logs instead of the entire name --man-page Print a generated manual page to stdout --matrix stringArray specify which matrix configuration to include (e.g. --matrix java:13 --network string Sets a docker network name. Defaults to host. (default "host") --no-cache-server Disable cache server --no-recurse Flag to disable running workflows from subdirectories of specified path in '--workflows'/'-W' flag --no-skip-checkout Do not skip actions/checkout -P, --platform stringArray custom image to use per platform (e.g. -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04) --privileged use privileged mode -p, --pull pull docker image(s) even if already present (default true) -q, --quiet disable logging of output from steps --rebuild rebuild local action docker image(s) even if already present (default true) --remote-name string git remote name that will be used to retrieve url of git repo (default "origin") --replace-ghe-action-token-with-github-com string If you are using replace-ghe-action-with-github-com and you want to use private actions on GitHub, you have to set personal access token --replace-ghe-action-with-github-com stringArray If you are using GitHub Enterprise Server and allow specified actions from GitHub (github.com), you can set actions on this. (e.g. --replace-ghe-action-with-github-com =github/super-linter) -r, --reuse don't remove container(s) on successfully completed workflow(s) to maintain state between runs --rm automatically remove container(s)/volume(s) after a workflow(s) failure -s, --secret stringArray secret to make available to actions with optional value (e.g. -s mysecret=foo or -s mysecret) --secret-file string file with list of secrets to read from (e.g. --secret-file .secrets) (default ".secrets") --use-gitignore Controls whether paths specified in .gitignore should be copied into container (default true) --use-new-action-cache Enable using the new Action Cache for storing Actions locally --userns string user namespace to use --var stringArray variable to make available to actions with optional value (e.g. --var myvar=foo or --var myvar) --var-file string file with list of vars to read from (e.g. --var-file .vars) (default ".vars") -v, --verbose verbose output --version version for act -w, --watch watch the contents of the local repo and run when files change -W, --workflows string path to workflow file(s) (default "./.github/workflows/")
⧠ãããå ¨ãåããã...
ã¨ããããã
⧠ä¸è¨ãµã¤ãæ§ãåèã«ãgit cloneãã¦ãã¦ããã試ãã¦ã¿ãã
ã¾ãã¯ããArchLinuxãç°å¢ã§ãgit cloneãã¦ããã¼ã«ã«ç°å¢ã«ãGitãªãã¸ããªãããã¦ã³ãã¼ãã
ããã¸ã§ã¯ãã®æ§æã¯ä»¥ä¸ã
ã.github/workflows/pytest.ymlãã¯ã
â§ å ¬å¼ã®å 容ãåèã«ã以ä¸ã®ãããªæãã«ã
â /home/ts0818/work/test-github-actions-auto-test/.github/workflows/pytest.yml
name: Python package on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r app/requirements.txt - name: Test with pytest run: | pip install pytest pytest-cov pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
ã§ãå®è¡ãã¦ã¿ãã
act -W .github/workflows/pytest.yml
⧠ã¯ããã¨ã©ã¼ã
ããã¦ãã³ã³ãããæ®ãããï½ãï¼
ã¨ã©ã¼ã¯ããpytestãããPYTHONPATHãã解éã§ããªãã¨ãããã©ãèãã¦ããpytestãã®ãã°ãªæ°ããã¦ä»æ¹ãªããã ã...
ãVS Codeï¼Visual Studio Codeï¼ãä¸ã§ã¯ããpytestããåä½ãã¦ãã¾ãã®ãä½è¨ã«æ··ä¹±ããã¦ãããã®ãã...
ä½ããã
⧠stackoverflowã«ããã¨ããtestsããã£ã¬ã¯ããªé ä¸ã«ã__init__.pyããé ç½®ããã°è§£æ±ºããã¨ã®æ å ±ã
ã/home/ts0818/work/test-github-actions-auto-test/app/tests/__init__.pyããä½æãã¦ã¿ã¾ãããï¼ä¸èº«ã¯ç©ºï¼
ãpytestããæ£å¸¸ã«å®æ½ããã¾ããã
ãVS Codeï¼Visual Studio Codeï¼ãã®ãGUIãä¸ã§ãpytestããå®è¡ããå ´åã¯ãèªåçã«ã__init__.pyããä½æããã¦ããã£ã¦ãã¨ãªãããï¼
ã¡ãªã¿ã«ããWARNINGãããã£ãã¨ãã¦ããERRORããç¡ãå®æ½ãããå ´åã
⧠ã³ã³ãããèªåã§åé¤ããã模æ§ã
ã__init__.pyãã¯ãtestsããã£ã¬ã¯ããªç´ä¸ã«ã ãé ç½®ããã°è¯ãã®ãï¼
â§ã__init__.pyãã¯ãtestsããã£ã¬ã¯ããªç´ä¸ã«ã ãé ç½®ããã°è¯ãããã
ãpytestãã¯ã³ãã³ãã§ã®å®è¡æã«ãPYTHONPATHããæå®ã§ããããã«ãã¦ããã°è¯ãã£ãããããªããã¨ããæ°ããã¦ãªããªããã ã...
ã¡ãªã¿ã«ãã__init__.pyããç¡ãç¶æ ã ã¨ãäºåã«ãPYTHONPATHããè¨å®ãã¦ãã¦ãã¬ã³ç¡è¦ãããã®ãã...
æ¯åº¦ã¢ã¤ã¢ã¤æãå端ãªãâ¦
ä»åã¯ãã®ã¸ãã§ã
Â
Â