This is an automated email from the ASF dual-hosted git repository. sciabarracom pushed a commit to branch 0.9.0 in repository https://gitbox.apache.org/repos/asf/openserverless.git
commit 6d21b9ed8142ed67de58869d417a9f41a7ba39fe Author: Michele Sciabarra <[email protected]> AuthorDate: Wed Sep 2 23:28:23 2026 +0200 README and CONTRIBUTING --- CHANGES | 16 ---- CONTRIBUTING.md | 63 +++++++++------ README.md | 91 ++++++++++++++------- attic/README.md | 215 -------------------------------------------------- attic/VARIABLES.md | 42 ---------- attic/cloud-init.yaml | 205 ----------------------------------------------- attic/direnv-init.sh | 25 ------ olaris | 2 +- 8 files changed, 104 insertions(+), 555 deletions(-) diff --git a/CHANGES b/CHANGES deleted file mode 100644 index eaa6de4..0000000 --- a/CHANGES +++ /dev/null @@ -1,16 +0,0 @@ -# opneserverless team 8 July - -Full build testing and licenses - -# sciabarracom 17 May 2026 - -runtimes, streamer and system api compilation - -# sciabarracom 30 Apr 2026 - -- archived old readme and dev environment files (moved in attic) -- build from sources compiling the cli (updated the README.md) - -# sciabarracom 3 May 2026 -- `Taskfile.yml` for building the operator -- `test.sh` for a smoke test \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef3969b..2d83493 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,25 +23,23 @@ Anyone can contribute to the OpenServerless project and we welcome your contributions. There are multiple ways to contribute: report bugs, improve the docs, and -contribute code, but you must follow these prerequisites and guidelines: +contribute code. Whichever you choose, please follow the prerequisites and +guidelines below. -- [Contributing to Apache OpenServerless (incubating)](#contributing-to-apache-openserverless-incubating) - - [Contributor License Agreement](#contributor-license-agreement) - - [Raising issues](#raising-issues) - - [Discussion](#discussion) - - [Coding standards](#coding-standards) +## Contributor License Agreement -### Contributor License Agreement +Contributors of significant changes must sign and submit an Apache ICLA +(Individual Contributor License Agreement). Small contributions, such as +documentation fixes, can be accepted at the discretion of the PMC without one, +so do not let this stop you from opening your first pull request. -All contributors must sign and submit an Apache CLA (Contributor License Agreement). +Instructions on how to sign can be found here: +[https://www.apache.org/licenses/contributor-agreements.html](https://www.apache.org/licenses/contributor-agreements.html) -Instructions on how to do this can be found here: -[http://www.apache.org/licenses/#clas](http://www.apache.org/licenses/#clas) - -Sign the appropriate CLA and submit it to the Apache Software Foundation (ASF) secretary. You will receive a confirmation email from the ASF and be added to -the following list: http://people.apache.org/unlistedclas.html. Once your name is on this list, you are done and your PR can be merged. - -Project committers will use this list to verify pull requests (PRs) come from contributors that have signed a CLA. +Sign the appropriate agreement and submit it to the Apache Software Foundation +(ASF) secretary. You will receive a confirmation email from the ASF once it has +been recorded. Project committers verify that pull requests come from +contributors covered by an ICLA where one is required. We look forward to your contributions! @@ -50,22 +48,43 @@ We look forward to your contributions! Please raise any bug reports or enhancement requests on the main project repository's GitHub [issue tracker](https://github.com/apache/openserverless/issues). Be sure to search the list to see if your issue has already been raised. -A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong. +A good bug report is one that makes it easy for us to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue. A good enhancement request comes with an explanation of what you are trying to do and how that enhancement would help you. ### Discussion -Please use the project's developer email list to engage our community: -[[email protected]]([email protected]) +Please use the project's developer mailing list to engage our community: +[[email protected]](mailto:[email protected]) + +The mailing list is the preferred contact medium. Subscribe by sending an email to +[[email protected]](mailto:[email protected]) +and then replying to the confirmation message. + +You can also find us on the `#openserverless` channel on the +[ASF Slack](https://infra.apache.org/slack.html), but please prefer the mailing +list: at Apache, project decisions must be discussed and recorded there. -In addition, we provide a [Telegram](https://t.me/+XhbCjBrkkaNkOWM0) team channel for conversation and support. +## Building and testing -### Coding standards +Before opening a pull request, please build and test your changes locally. +See the [README](README.md) for how to set up a development environment and for +the per-platform build and test scripts. + +## Coding standards Please ensure you follow the coding standards used throughout the existing code base. Some basic rules include: - - all files must have the Apache license in the header. - - all PRs must have passing builds for all operating systems (where this is applicable). \ No newline at end of file + - all files must have the Apache license in the header. Check this with + `task license` before opening a pull request (it requires + [license-eye](https://github.com/apache/skywalking-eyes)). + - all PRs must have passing builds for all operating systems (where this is applicable). + +## Pull requests + + - open pull requests against the `main` branch unless a committer directs you otherwise. + - keep each pull request focused on a single change, and describe what it does and why. + - reference the related GitHub issue in the description, if there is one. + - be prepared to address review comments; committers may ask you to rebase before merging. diff --git a/README.md b/README.md index 7761dca..68ef127 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # Apache OpenServerless (incubating) -Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incubating project at the [Apache Software Foundation](https://www.apache.org) +Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incubating project at the [Apache Software Foundation](https://www.apache.org). -- If you want to **install** Apache OpenServerless in cloud go [here](https://openserverless.apache.org/docs/installation/). +- If you want to **install** Apache OpenServerless in the cloud go [here](https://openserverless.apache.org/docs/installation/). - If you want to **understand** what this project is check the [original proposal](https://cwiki.apache.org/confluence/display/INCUBATOR/OpenServerlessProposal). -- If you want to **discuss** with us, join our mailing list sending an email to `[email protected]` +- If you want to **discuss** with us, join our mailing list by sending an email to `[email protected]` +- If you want to **contribute** to the project, read [this guide](CONTRIBUTING.md) -- If you want to **contribute** to the project, building from the sources or setting up a **development** environment, read on this README. - -# Build and test from sources +## Build and test from sources > [!WARNING] > Building from the latest sources in git is **not recommended for production > use**. The `main` branch may contain unstable, untested, or incomplete > changes. For production deployments, use an official release tarball instead. @@ -27,55 +26,67 @@ git clone --branch <branch> https://github.com/apache/openserverless --recurse-s cd openserverless ``` +> [!IMPORTANT] +> Most of the code lives in git submodules, so `--recurse-submodules` is required. +> If you already cloned without it, run `git submodule update --init --recursive` +> before building, otherwise the submodule directories are empty and the build +> fails in confusing ways. + You can then build and test as follows. -# Linux +### Linux -You need Ubuntu 22+ or Debian 11+. Execute: +You need Ubuntu 22+ or Debian 11+. Execute: `./build-and-test-ubuntu.sh` It can work on other distros but you have to adapt the scripts. -# Windows +### Windows You need Windows 10/11 with WSL. Execute from PowerShell: `.\build-and-test-windows.ps1` -# Mac OSX +### macOS -You have to install [lima](https://limma-vm.io) (example: brew install lima). Execute: +You have to install [lima](https://lima-vm.io) (example: `brew install lima`). Execute: `./build-and-test-mac.sh` -# Development setup +## Development setup -## Prerequisites +### Prerequisites -- you need an Unix environment, either OSX, Linux or Windows WSL. +- you need a Unix environment, either macOS, Linux or Windows WSL. - you need docker on the path - you need go available on the path - you need task (https://taskfile.dev) available in the path +- you need jq, zip, unzip and kubectl available on the path +- you need license-eye on the path, to check the license headers -Here the procedures for MacOS, Windows 11 and Ubuntu Linux +The per-platform sections below install all of these. Here are the procedures +for macOS, Windows 11 and Ubuntu Linux. -## Prepare Mac +### Prepare Mac -On Mac, install brew and Docker Desktop. then do +On Mac, install brew and Docker Desktop, then do -- `brew install task` -- `brew install go` +``` +brew install task go jq kubernetes-cli +go install github.com/apache/skywalking-eyes/cmd/license-eye@latest +export PATH="$PATH:$(go env GOPATH)/bin" +``` -## Prepare Windows +### Prepare Windows -On windows, -- install Docker Desktop then +On Windows, +- install Docker Desktop, then - `wsl --install Ubuntu-24.04` then enable docker to be used in the distro `Ubuntu-24.04` -Access the distro (`wsl -d Ubuntu-24.04` ), configure a new user, then execute: +Access the distro (`wsl -d Ubuntu-24.04`), configure a new user, then execute: ``` sudo apt-get update @@ -83,11 +94,13 @@ sudo apt-get -y install jq unzip zip sudo snap install go --classic sudo snap install task --classic sudo snap install kubectl --classic +go install github.com/apache/skywalking-eyes/cmd/license-eye@latest +export PATH="$PATH:$(go env GOPATH)/bin" ``` -## Prepare Ubuntu or Debian Linux +### Prepare Ubuntu or Debian Linux -Setup for a plain Ubuntu Linux with an user with sudo power: +Setup for a plain Ubuntu Linux with a user with sudo power: ``` sudo apt-get update @@ -103,17 +116,37 @@ newgrp docker docker ps ``` -## Procedure +### Procedure ``` git clone https://github.com/apache/openserverless --recurse-submodules cd openserverless ``` -You can build with: `task build` +To work on a release branch instead of `main`, add `--branch <branch>`. -You can run the test suite with: `task test` +You can build with: `task build` + +You can run the test suite with: `task test` You can check all the files have the license header: `task license` -Read the task files (that are basically shell scripts wrapped in an yaml environment) to learn all the build procedures. +Read the task files (that are basically shell scripts wrapped in a yaml environment) to learn all the build procedures. + +## License + +Apache OpenServerless is licensed under the [Apache License, Version 2.0](LICENSE). +See also the [NOTICE](NOTICE) file. + +## Disclaimer + +Apache OpenServerless (Incubating) is an effort undergoing incubation at the Apache +Software Foundation (ASF), sponsored by the Apache Incubator PMC. + +Incubation is required of all newly accepted projects until a further review +indicates that the infrastructure, communications, and decision making process +have stabilized in a manner consistent with other successful ASF projects. + +While incubation status is not necessarily a reflection of the completeness +or stability of the code, it does indicate that the project has yet to be +fully endorsed by the ASF. diff --git a/attic/README.md b/attic/README.md deleted file mode 100644 index 236ee1e..0000000 --- a/attic/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# Apache OpenServerless (incubating) - -Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incubating project at the [Apache Software Foundation](https://www.apache.org) - -- If you want to **install** Apache OpenServerless in cloud go [here](https://openserverless.apache.org/docs/installation/). -- If you want to **understand** what this project is check the [original proposal](https://cwiki.apache.org/confluence/display/INCUBATOR/OpenServerlessProposal). -- If you want to **contribute** to the project, read on this README to setup a **development** environment. -- If you want to **chat** with us, join [our Discord server](https://bit.ly/openserverless-discord). -- If you want to **locally install** open serverless for test or development, read on. - -## Test Environment Overview - -Apache OpenServerless is a complex project with lots of dependencies. It also needs a Kubernetes cluster to be executed, tested and developed on. - -To quickly create a development enviromnemt we use a virtual machine in your workstation created with [multipass](https://multipass.run/). - -You need a virtual machine with at least 8GB of memory and 4 VCPU so your development workstation probably needs at least 16GB and 6 VCPU. Your mileage may vary. - -Read on how to create a test environment. - -## Install Multipass - -Here we describe how to setup the development virtual machine on Linux, Mac and Windows using multipass. First, install multipass. - -- On Mac, if you already have [brew](https://brew.sh/), installing it is as easy as to type `brew install --cask multipass`. - -- On Linux, if you already have [snap](https://snapcraft.io/), installing it is as easy as type `sudo snap install multipass`. - -- On Windows, you need Windows 10 Pro/Enterprise/Education v1803 or later, or any Windows 10 with VirtualBox. Make sure your local network is designated as private, otherwise Windows prevents Multipass from starting. - -Download the multipass installer from [here](https://multipass.run/download/windows) and run the installer. Pick Hyperv in preference, VirtualBox as an alternative. - -- Alternative installation options are available [here](https://multipass.run/install) - -## Setup a development VM using multipass - -The steps and the commands to install the development VM are the same in Linux, Windows and Mac. - -Once you have `multipass` installed, open a terminal or powershell and type the following command: - -``` -multipass launch -nopsv -c6 -d40g -m16g --cloud-init https://raw.githubusercontent.com/apache/openserverless/main/cloud-init.yaml -``` - -Wait until the vm is launched and you see messages like `Launched: openserverless` (message can be different depending on multipass version effectively installed). - -Complete the installation with the following command: - -``` -multipass exec opsv ./waitready -``` - -Your VM is ready. - -## (Optional) Configure Kubectl access - -If you need administrative access to the vm, copy the `.kube/config` file inside the VM locally, then check if you have access: - -``` -mkdir $HOME/.kube -# warning this overwrites an exiting kube config -multipass exec opsv cat .kube/config >$HOME/.kube/config -# you need kubectl installed -kubectl get nodes -``` - -You should see something like this: - -``` -NAME STATUS ROLES AGE VERSION -opsv Ready control-plane,master 4h58m v1.29.6+k3s1 -``` - -# Development Environment Overview - -If you only want to test OpenServerless, stop here. You should have a working environment. - -The rest of this readme describes how to create a development enviroment within the vm. - -You need to setup the test environment with multipass before going on with the Development Environment. - -As an IDE we use [VSCode](https://code.visualstudio.com/) as it allows [Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) within the virtual machine, and we provide a workspace for it. - -You may setup the environment by yourself, but it can take a lot of time so we prepared a procedure to setup quickly a ready-to-use development environment which runs the same on Windows, Linux and Mac. - -Our development environment uses a virtual machine based on Ubuntu 24.04. The virtual environemnt is initialized with a [cloud-init](https://cloud-init.io/) script we provide. - -The script installs [k3s](https://k3s.io/) as Kubernetes engine and [nix](https://nixos.org/download/#download-nix) to setup development environments. The project includes multiple subprojects, each one with a different set of dependencies so we use [direnv](https://direnv.net/) to automatically activate the right tools when you open a terminal. - -*NOTE*: of course you can operate variations. It should be relatively easy to run the development virtual machine in a cloud provider using the provided cloud-init script. Basically all the cloud providers allows to build a VM using cloud-init. -We do not provide instructions how to setup on the various cloud provider (yet). - -You can even setup the development environment by yourself without using the virtual machine, and use a different IDE, but adapting the configuration for your IDE is up to you and could be very time-consuming. Our development environment is the result of a few years of fine tuning, so we do not expect it will be easy to change. - -## Install openserverless and tools in the VM - -By default the vm is only for testing, there is no development code inside. - -If you are a developer, fefore accessing the VM use this command to dowload the soucre code and tools you need to for development: - -``` -multipass exec opsv ./i-am-a-developer -``` - -You may need to wait a little bit before everything is ready. - -Once everything is ready, read on to configure access to the vm using VSCode. - -## Configure SSH access for VSCode - -To access the virtual machine from VSCode you need to setup a ssh key and create a configuration. Open a terminal (powershell on Windows) and follow those steps: - -1. Check if you already have a key in `$HOME/.ssh/id_rsa`. If not, generate one with `ssh-keygen -t rsa` then press enter to confirm. - -2. Copy the key in the virtual machine to allow no password access: - -``` -multipass transfer $HOME/.ssh/id_rsa.pub opsv: -multipass exec opsv -- bash -c "cat id_rsa.pub | tee -a .ssh/authorized_keys" -``` - -3. Create a configuration named `opsv` to easily access it. - -First type `multipass list`. You will see something like this: - -``` -Name State IPv4 Image -opsv Running 10.6.73.253 Ubuntu 24.04 LTS - 10.42.0.0 - 10.42.0.1 -``` - -Take note of the `<IP>` in the `opsv` line (in this example `10.6.73.253` but your value can be different) - -Use an editor to add to the file `~/.ssh/config` the following: - -``` -Host opsv - Hostname <IP> - User ubuntu - IdentityFile ~/.ssh/id_rsa -``` - -4. Check you have access without password: - -``` -ssh opsv -``` - -Once you accessed the VM configure git with your username and email: - -``` -git config --global user.name "<your-name>" -git config --global user.email "<your-email>" -``` - -## Access the virtual machine with VSCode - -1. Install [VSCode](https://code.visualstudio.com/) - -2. Type F1 then "Install Extensions" (or click on the task bar the package icon) - -3. Search "remote ssh" and install the extension "Remote - SSH" - -4. Type F1 then "Connect" (or click on the `><` symbol in the corner to the left at the bottom) and select "Remote-SSH: Connect Current Windows to Host" - -5. Click on `opsv` then select Linux if requested - -6. Click on the menu bar on `File` then `Openworkspace from file`, then select the `openserverless` folder and open one of the workspaces. Currently: - -- `openserverless-cli.code-workspace`: for the CLI along with task -- `openserverless-operator.code-workspace`: for the Operator alone -- `openserverless.code-workspace`: for the root with the Operator and the site - -Select `Linux` and then `Trust the authors` if requested. - -## Access to the subprojects - -Now you have all the repositories in your virtual machine and the subprojects. Furthermore, in the VM it is configured `nix` that will setup all the dependencies to develop the subprojects, and `direnv` that activates the right dependencies when you open the terminal in a subproject. - -For example try to execute `Terminal > New Terminal` and you will see you can choose the subproject. If you select `website` for example, the system will download all the dependencies to build the web site, in this case `hugo` and `npm` and install the required tools `postcss`. - -## Use Git Submodules - -Apache OpenServerless uses git submodules. - -This means in practice two things: you have to do Pull Requests and changes forking the subprojects individually. - -Then you have from time to time to update the whole subtree to the latest releases of all the subprojects. - -### Contributing to subprojects - -To contribute to a subproject: - -- fork a subproject: for example `github.com/apache/openserverless-website` into `github.com/<username>/openserverless-website` -- add a remote to the subproject to point to your fork: for example after opening the `website` terminal, add `git remote add <username> github.com/<username>/openserverless-website` -- now you can change the code and push in your fork: `git push <username> main` -- you can now contribute a Pull Request - -### Syncronize the tree - -Open a terminal in the `root` subproject and type `./update-tree.sh`. This script will update all the subprojects to the latest available version on the main repo. - -Do not worry about contributing PR to update dependencies as the maintainers will periodically take care of this. - -## Cleanup - -If you do not want to keep the VM anymore, ensure you have backed up all your files. Then remove it from your cloud provider (check your cloud provider documentation). - -For multipass, use the following commands to cleanup: - -``` -multipass delete opsv --purge -``` - diff --git a/attic/VARIABLES.md b/attic/VARIABLES.md deleted file mode 100644 index bc7ba3d..0000000 --- a/attic/VARIABLES.md +++ /dev/null @@ -1,42 +0,0 @@ -# Variables in OpenServerless Task - -This document lists general guidelines to define OpenServerless Tasks variable via the `ops` cli. - -## General info: - -OpenServerless Tasks variable are typically set issuing a command like `ops config VARIABLE=<value>`. These variable are stored under the `~/.ops/config.json` file. Variables name are splitted over the `_` character and the resulting parts are used to compose a json nested object having all the parts, that is given a variable with value `OPERATOR_COMPONENT_MINIO=true` the resulting json persisted into the configuration file will be something like - -```json -{ - "operator":{ - "component":{ - "minio":true - } - } -} -``` - -## General guidelines: - -With the above described behavior we have defined some general rules to be adopted when developing/updating OpenServerless Tasks variables - -- Avoid to define variable starting with `OPS_` prefix. This prefix is reserved to the `ops` general config itself, and normally defined inside the `opsroot.json`. It is better to clearly distinguish task variable from the `ops` generated/reserved ones. -- Considering the `_` splitting rules, prefer variable names composed by a maximum of 4 parts to avoid too much nested `json` structure. This is to simplify readability of the `config.json` if manually inspected. -- Do not override variable used for configuration, with values obtained after the configuration has been applied (to create/update an Apache OpenServerless instance). This is to guarantee that we can always reconstruct the original `config.json` file. For instance OPS tasks defines an `OPERATOR_CONFIG_APIHOST` that should not be overridden. It is better to define a `OUTPUT_APIHOST` instead. -- Specify volume size parameters with numerical value expressed as GB -- Specify memory size parameters with numerical value expressed as GB - -## Variable prefixes category - -This is a comprehensive list of variable prefix used in Ops tasks describing their purpose - -| Variable Prefix | Purpose | -|---|---| -| OPERATOR_COMPONENT_ | Used to defined which OpenServerless Components needs to be deployed by the Operator | -| OPERATOR_CONFIG_ | Global Ops Operator configuration parameters | -| OPENWHISK_CONTROLLER_ | OpenWhisk Controller Configuration | -| OPENWHISK_INVOKER_ | OpenWhisk Invoker Configuration | -| OPENWHISK_ | OpenWhisk General configuration for limits, triggers etc etc | -| STORAGE_SIZE_ | Used to define various component allocated volumes size | -| SECRET_ | Used to define autogenerated secret | -| OUTPUT_ | Used to define calculated configuration parameters that are result of applying ops tasks against a running OpenServerless instance, if applies (APIHOST is one of them) | \ No newline at end of file diff --git a/attic/cloud-init.yaml b/attic/cloud-init.yaml deleted file mode 100644 index 3cd077d..0000000 --- a/attic/cloud-init.yaml +++ /dev/null @@ -1,205 +0,0 @@ -#cloud-config -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -apt_update: true -apt_upgrade: true -packages: - - at - -users: - - name: ubuntu - uid: 1000 - groups: sudo - shell: /bin/bash - sudo: ['ALL=(ALL) NOPASSWD:ALL'] - -write_files: - - path: /etc/cloud-init.sh - permissions: '0755' - owner: root:root - content: | - echo "OPS_CLOUD_INIT_VER=3" >>/etc/environment - IP="$(ip -o -4 addr | awk '$2 ~/en/ { print $4}' | cut -d/ -f1)" - # install k3s, direnv, task - curl -sfL https://get.k3s.io | sh - - # set home and user - USR="$(getent passwd 1000 | awk -F: '{print $1}')" - HOME="/home/$USR" - # copy authkey if there is a root one - mkdir -p /home/$USR/.ssh - if test -e /root/.ssh/authorized_keys - then cat /root/.ssh/authorized_keys >>/home/$USR/.ssh/authorized_keys - fi - # access k3s - mkdir -p "$HOME/.kube" - cat /etc/rancher/k3s/k3s.yaml "$HOME/.kube/config" | sed -e 's!server: https://127.0.0.1:!server: https://'$IP':!' >"$HOME/.kube/config" - echo "export KUBECONFIG=/home/$USR/.kube/config" >>$HOME/.bashrc - chown -Rvf "$USR" /home/$USR - #sudo -u $USR bash /etc/install-opsv.sh - echo "== DONE ==" - - - path: /etc/install-opsv.sh - permissions: '0755' - owner: root:root - content: | - curl -sL bit.ly/get-ops | bash - # TODO: use the released version not main - echo "export OPS_BRANCH=main" >> ~/.bashrc - source ~/.bashrc - ops -t - ops -info - # configure opsv - ops config slim - IP="$(ip -o -4 addr | awk '$2 ~/en/ { print $4}' | cut -d/ -f1)" - ops config apihost "$IP.nip.io" - ops setup cluster - - - path: /home/ubuntu/waitready - permissions: '0755' - owner: ubuntu:ubuntu - defer: true - content: | - #!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - sudo cloud-init status --wait - tail -f /tmp/cloud-init.log | while read line - do echo "$line" - if [[ "$line" == *"== DONE =="* ]] - then exit 0 - fi - done - - - path: /home/ubuntu/i-am-a-developer - permissions: '0755' - defer: true - owner: ubuntu:ubuntu - content: | - # get openserverless sources - cd $HOME - # install task and skywalking-eyes - sudo snap install task --classic - sudo snap install go --classic - go install github.com/apache/skywalking-eyes/cmd/license-eye@latest - echo "export PATH=\$PATH:\$HOME/go/bin" >> .bashrc - # install direnv and nix - curl -sL https://nixos.org/nix/install | sh - source .profile - curl -sL https://direnv.net/install.sh | sudo bash - echo 'eval "$(direnv hook bash)"' >> .bashrc - source .bashrc - # setup openserverless - git clone https://github.com/apache/openserverless.git --recurse-submodules - cd openserverless - bash sync-branch.sh - bash direnv-init.sh - # TODO add a .git-hooks directory with hooks - #git config core.hooksPath .git-hooks - -runcmd: - - | - cd /home/ubuntu - # add z.sh and .aliases - curl -sL "https://raw.githubusercontent.com/rupa/z/master/z.sh" -o ".z.sh" - curl -sL https://raw.githubusercontent.com/sciabarracom/openserverless/refs/heads/main/bash_aliases -o ".bash_aliases" - echo 'source $HOME/.z.sh' >> .bashrc - chown ubuntu:ubuntu .z.sh .bashrc .bash_aliases - echo -e '#!/bin/bash\n/etc/cloud-init.sh 2>&1 >/tmp/cloud-init.log\n' | at now diff --git a/attic/direnv-init.sh b/attic/direnv-init.sh deleted file mode 100755 index c3de937..0000000 --- a/attic/direnv-init.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -git clone https://github.com/nix-community/nix-direnv $HOME/nix-direnv -mkdir -p $HOME/.config/direnv -echo 'source $HOME/nix-direnv/direnvrc' >>$HOME/.config/direnv/direnvrc -find . -name '.envrc' -execdir direnv allow . pwd \; -find . -name '.envrc' -execdir direnv exec . pwd \; - diff --git a/olaris b/olaris index 795b702..ef51e9b 160000 --- a/olaris +++ b/olaris @@ -1 +1 @@ -Subproject commit 795b7026c12d9332689b79e679d7152df01754f8 +Subproject commit ef51e9bbd1a13aacd71ca21c110109e62ab715b6
