├── .asf.yaml ├── .github ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ └── FEATURE_REQUEST.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── CONTRIBUTING.md ├── DISCLAIMER ├── LICENSE ├── NOTICE ├── README.md ├── ROADMAP.md ├── VARIABLES.md ├── VERSIONS.md ├── aliases ├── assets └── logos │ ├── png │ ├── os-logo-bg-white.png │ ├── os-logo-full-horizontal-transparent.png │ ├── os-logo-full-vertical-bg-white.png │ ├── os-logo-full-vertical-transparent.png │ └── os-logo-transparent.png │ └── svg │ ├── os-logo-full-horizontal-transparent.svg │ ├── os-logo-full-vertical-bg-white.svg │ ├── os-logo-full-vertical-transparent.svg │ ├── os-logo-icon-bg-white.svg │ └── os-logo-icon-transparent.svg ├── cloud-init.yaml ├── devel └── images │ └── standalone │ ├── Dockerfile │ └── Taskfile.yml ├── direnv-init.sh ├── get-diff.sh ├── openserverless-cli.code-workspace ├── openserverless-operator.code-workspace ├── openserverless.code-workspace ├── sync-branch.sh └── update-tree.sh /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | github: 19 | description: "Apache OpenServerless (incubating)" 20 | homepage: https://openserverless.apache.org 21 | labels: 22 | - openserverless 23 | - cloud 24 | - serverless 25 | - kubernetes 26 | 27 | enabled_merge_buttons: 28 | merge: false 29 | squash: true 30 | rebase: true 31 | 32 | protected_branches: 33 | main: 34 | required_linear_history: true 35 | required_status_checks: 36 | strict: true 37 | required_pull_request_reviews: 38 | required_approving_review_count: 1 39 | dismiss_stale_reviews: true 40 | required_conversation_resolution: true 41 | 42 | features: 43 | wiki: true 44 | issues: true 45 | projects: true 46 | 47 | collaborators: [] # Note: the number of collaborators is limited to 10 48 | 49 | ghp_branch: gh-pages 50 | ghp_path: / 51 | 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | 4 | about: If you would like to report an issue to OpenServerless, please use this template. 5 | 6 | --- 7 | - [ ] I have searched the [issues](https://github.com/apache/openserverless/issues) of this repository and believe that this is not a duplicate. 8 | 9 | ### Ⅰ. Issue Description 10 | 11 | 12 | ### Ⅱ. Describe what happened 13 | 14 | If there is an exception, please attach the exception trace: 15 | 16 | ``` 17 | Just paste your stack trace here! 18 | ``` 19 | 20 | 21 | ### Ⅲ. Describe what you expected to happen 22 | 23 | 24 | ### Ⅳ. How to reproduce it (as minimally and precisely as possible) 25 | 26 | 1. xxx 27 | 2. xxx 28 | 3. xxx 29 | 30 | Minimal yet complete reproducer code (or URL to code): 31 | 32 | 33 | ### Ⅴ. Anything else we need to know? 34 | 35 | ### Ⅵ. Environment: 36 | 37 | - K8S Runtime and version: 38 | - OPS CLI version: 39 | - Others: -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | 4 | about: Suggest an idea for OpenServerless 5 | 6 | --- 7 | ## Why you need it? 8 | Is your feature request related to a problem? Please describe in details 9 | 10 | ## How it could be? 11 | A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it. 12 | 13 | ## Other related information 14 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | - [ ] I have registered the PR [changes](../changes). 4 | 5 | ### Ⅰ. Describe what this PR did 6 | 7 | 8 | ### Ⅱ. Does this pull request fix one issue? 9 | 10 | 11 | 12 | ### Ⅲ. Why don't you add test cases (unit test/integration test)? 13 | 14 | 15 | ### Ⅳ. Describe how to verify it 16 | 17 | 18 | ### Ⅴ. Special notes for reviews -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .attic/ 2 | .vscode/ 3 | .idea/ 4 | **/.DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "site"] 2 | path = site 3 | url = https://github.com/apache/openserverless-site 4 | branch = main 5 | [submodule "cli"] 6 | path = cli 7 | url = https://github.com/apache/openserverless-cli 8 | branch = main 9 | [submodule "operator"] 10 | path = operator 11 | url = https://github.com/apache/openserverless-operator 12 | branch = main 13 | [submodule "testing"] 14 | path = testing 15 | url = https://github.com/apache/openserverless-testing 16 | branch = main 17 | [submodule "task"] 18 | path = task 19 | url = https://github.com/apache/openserverless-task 20 | branch = main 21 | [submodule "runtimes"] 22 | path = runtimes 23 | url = https://github.com/apache/openserverless-runtimes 24 | branch = main 25 | [submodule "devel/olaris"] 26 | path = devel/olaris 27 | url = https://github.com/apache/openserverless-task 28 | branch = devel 29 | [submodule "devel/olaris-operator"] 30 | path = devel/olaris-operator 31 | url = https://github.com/apache/openserverless-operator 32 | branch = devel 33 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 19 | [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) 20 | 21 | # Contributing to Apache OpenServerless (incubating) 22 | 23 | Anyone can contribute to the OpenServerless project and we welcome your contributions. 24 | 25 | There are multiple ways to contribute: report bugs, improve the docs, and 26 | contribute code, but you must follow these prerequisites and guidelines: 27 | 28 | - [Contributing to Apache OpenServerless (incubating)](#contributing-to-apache-openserverless-incubating) 29 | - [Contributor License Agreement](#contributor-license-agreement) 30 | - [Raising issues](#raising-issues) 31 | - [Discussion](#discussion) 32 | - [Coding standards](#coding-standards) 33 | 34 | ### Contributor License Agreement 35 | 36 | All contributors must sign and submit an Apache CLA (Contributor License Agreement). 37 | 38 | Instructions on how to do this can be found here: 39 | [http://www.apache.org/licenses/#clas](http://www.apache.org/licenses/#clas) 40 | 41 | 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 42 | 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. 43 | 44 | Project committers will use this list to verify pull requests (PRs) come from contributors that have signed a CLA. 45 | 46 | We look forward to your contributions! 47 | 48 | ## Raising issues 49 | 50 | 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 51 | list to see if your issue has already been raised. 52 | 53 | A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong. 54 | Provide as much context as possible so we can try to recreate the issue. 55 | 56 | A good enhancement request comes with an explanation of what you are trying to do and how that enhancement would help you. 57 | 58 | ### Discussion 59 | 60 | Please use the project's developer email list to engage our community: 61 | [dev@openserverless.apache.org](dev@openserverless.apache.org) 62 | 63 | In addition, we provide a [Telegram](https://t.me/+XhbCjBrkkaNkOWM0) team channel for conversation and support. 64 | 65 | ### Coding standards 66 | 67 | Please ensure you follow the coding standards used throughout the existing 68 | code base. Some basic rules include: 69 | 70 | - all files must have the Apache license in the header. 71 | - all PRs must have passing builds for all operating systems (where this is applicable). -------------------------------------------------------------------------------- /DISCLAIMER: -------------------------------------------------------------------------------- 1 | Apache OpenServerless (Incubating) is an effort undergoing incubation at the Apache 2 | Software Foundation (ASF), sponsored by the Apache Incubator PMC. 3 | 4 | Incubation is required of all newly accepted projects until a further review 5 | indicates that the infrastructure, communications, and decision making process 6 | have stabilized in a manner consistent with other successful ASF projects. 7 | 8 | While incubation status is not necessarily a reflection of the completeness 9 | or stability of the code, it does indicate that the project has yet to be 10 | fully endorsed by the ASF. 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache OpenServerless (Incubating) 2 | Copyright 2024 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apache OpenServerless (incubating) 2 | 3 | Welcome to [Apache OpenServerless](https://openserverless.apache.org), an incubating project at the [Apache Software Foundation](https://www.apache.org) 4 | 5 | - If you want to **install** Apache OpenServerless go [here](https://openserverless.apache.org/docs/installation/). 6 | - If you want to **understand** what this project is check the [original proposal](https://cwiki.apache.org/confluence/display/INCUBATOR/OpenServerlessProposal). 7 | - If you want to **contribute** to the project, read on this README to setup a **development** environment. 8 | - If you want to **chat** with us, join [our Discord server](https://bit.ly/openserverless-discord). 9 | 10 | ## Development Environment Overview 11 | 12 | Apache OpenServerless is a complex project with lots of dependencies. It also needs a Kubernetes cluster to be executed, tested and developed on. 13 | 14 | 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. 15 | 16 | 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. 17 | 18 | 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. 19 | 20 | To create a virtual machine in your workstation we use [multipass](https://multipass.run/). 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. 21 | 22 | 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. 23 | 24 | *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. 25 | We do not provide instructions how to setup on the various cloud provider (yet). 26 | 27 | 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. 28 | 29 | ## Install Multipass 30 | 31 | Here we describe how to setup the development virtual machine on Linux, Mac and Windows using multipass. First, install multipass. 32 | 33 | - On Mac, if you already have [brew](https://brew.sh/), installing it is as easy as to type `brew install multipass`. 34 | 35 | - On Linux, if you already have [snap](https://snapcraft.io/), installing it is as easy as type `sudo snap install multipass`. 36 | 37 | - 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. 38 | 39 | Download the multipass installer from [here](https://multipass.run/download/windows) and run the installer. Pick Hyperv in preference, VirtualBox as an alternative. 40 | 41 | - Alternative installation options are available [here](https://multipass.run/install) 42 | 43 | ## Setup a development VM using multipass 44 | 45 | The steps and the commands to install the development VM are the same in Linux, Windows and Mac. 46 | 47 | Once you have `multipass` installed, open a terminal or powershell and type the following command: 48 | 49 | ``` 50 | multipass launch -nopenserverless -c4 -d20g -m8g --cloud-init https://raw.githubusercontent.com/apache/openserverless/main/cloud-init.yaml 51 | ``` 52 | 53 | Now wait until the installation is complete and you see messages like `status: done` or `Launched: openserverless` (message can be different depending on multipass version effectively installed). 54 | 55 | ``` 56 | multipass exec "openserverless" -- sudo cloud-init status --wait 57 | ``` 58 | 59 | Finally check if Kubernetes (k3s) is up and running in the VM: 60 | 61 | ``` 62 | multipass exec openserverless sudo k3s kubectl get nodes 63 | ``` 64 | 65 | You should see something like this: 66 | 67 | ``` 68 | NAME STATUS ROLES AGE VERSION 69 | openserverless Ready control-plane,master 4h58m v1.29.6+k3s1 70 | ``` 71 | 72 | ## Configure SSH access for VSCode 73 | 74 | 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: 75 | 76 | 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. 77 | 78 | 2. Copy the key in the virtual machine to allow no password access: 79 | 80 | ``` 81 | multipass transfer $HOME/.ssh/id_rsa.pub openserverless: 82 | multipass exec openserverless -- bash -c "cat id_rsa.pub | tee -a .ssh/authorized_keys" 83 | ``` 84 | 85 | 3. Create a configuration named `openserverless` to easily access it. 86 | 87 | First type `multipass list`. You will see something like this: 88 | 89 | ``` 90 | Name State IPv4 Image 91 | openserverless Running 10.6.73.253 Ubuntu 24.04 LTS 92 | 10.42.0.0 93 | 10.42.0.1 94 | ``` 95 | 96 | Take note of the `` in the `openserverless line` (in this case `10.6.73.253` but your value can be different) 97 | 98 | Use an editor to add to the file `~/.ssh/config` the following: 99 | 100 | ``` 101 | Host openserverless 102 | Hostname 103 | User ubuntu 104 | IdentityFile ~/.ssh/id_rsa 105 | ``` 106 | 107 | 4. Check you have access without password: 108 | 109 | ``` 110 | ssh openserverless 111 | ``` 112 | 113 | Once you accessed the VM configure git with your username and email: 114 | 115 | ``` 116 | git config --global user.name "" 117 | git config --global user.email "" 118 | ``` 119 | 120 | ## Access the virtual machine with VSCode 121 | 122 | 1. Install [VSCode](https://code.visualstudio.com/) 123 | 124 | 2. Type F1 then "Install Extensions" (or click on the task bar the package icon) 125 | 126 | 3. Search "remote ssh" and install the extension "Remote - SSH" 127 | 128 | 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" 129 | 130 | 5. Click on `openserverless` then select Linux if requested 131 | 132 | 6. Click on the menu bar on `File` then `Openworkspace from file`, then select the `openserverless` folder and open one of the workspaces. Currently: 133 | 134 | - `openserverless-cli.code-workspace`: for the CLI along with task 135 | - `openserverless-operator.code-workspace`: for the Operator alone 136 | - `openserverless.code-workspace`: for the root with the Operator and the site 137 | 138 | 139 | Select `Linux` and then `Trust the authors` if requested. 140 | 141 | ## Access to the subprojects 142 | 143 | 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. 144 | 145 | 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`. 146 | 147 | ## Use Git Submodules 148 | 149 | Apache OpenServerless uses git submodules. 150 | 151 | This means in practice two things: you have to do Pull Requests and changes forking the subprojects individually. 152 | 153 | Then you have from time to time to update the whole subtree to the latest releases of all the subprojects. 154 | 155 | ### Contributing to subprojects 156 | 157 | To contribute to a subproject: 158 | 159 | - fork a subproject: for example `github.com/apache/openserverless-website` into `github.com//openserverless-website` 160 | - add a remote to the subproject to point to your fork: for example after opening the `website` terminal, add `git remote add github.com//openserverless-website` 161 | - now you can change the code and push in your fork: `git push main` 162 | - you can now contribute a Pull Request 163 | 164 | ### Syncronize the tree 165 | 166 | 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. 167 | 168 | Do not worry about contributing PR to update dependencies as the maintainers will periodically take care of this. 169 | 170 | ## Cleanup 171 | 172 | 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). 173 | 174 | For multipass, use the following commands to cleanup: 175 | 176 | ``` 177 | multipass delete openserverless --purge 178 | ``` 179 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | The roadmap is a high level overview of work we would like to see implemented. For more details and discussion of new features, improvements or bugs, please see the [issue list](https://github.com/apache/openserverless/issues) in GitHub. 4 | 5 | The order of the items does not pretend to to establish the project priorities. 6 | 7 | * OpenServerless Operator 8 | * Improvement: migrate to newer OpenWhisk 2.0.0 (controller+secheduler+invoker) 9 | * New: Integrate Apache Apisix 10 | * New: Implements admission webhooks for wsk and wsku resources 11 | * New: Implements a generic S3 Api aware plugin for User and Bucket creations 12 | * Improvement: Migrate to newer version of MINIO server 13 | * Improvement: Migrate to newer version os Postgres SQL 14 | * Improvement: Update to latest kopf version and latest Python version 15 | * Improvement: Deploy default nuvolaris namespace as a normal wsku resources 16 | * Improvement: Handle CouchDb init task as Operator managed task 17 | * Improvement: Use base images with smaller size for fast loading 18 | * New: Integrate Argo Events and implements system action to support deployment of argo events resources 19 | * New: Implement a new customizable Job to perform CouchDb maintenance task (database compaction, activations cleanup) 20 | * Refactoring: Adopt a plugin based implemenation 21 | * OpenServerless CLI (aka ops) 22 | * TODO 23 | * OpenServerless Tasks 24 | * New: implemens task to schedule actions using argo events supporting actions 25 | * OpenServerless runtimes 26 | * Improvement: call to runtime at / should implement /run behavior as OpenWhisk web actions. -------------------------------------------------------------------------------- /VARIABLES.md: -------------------------------------------------------------------------------- 1 | # Variables in OpenServerless Task 2 | 3 | This document lists general guidelines to define OpenServerless Tasks variable via the `ops` cli. 4 | 5 | ## General info: 6 | 7 | OpenServerless Tasks variable are typically set issuing a command like `ops config VARIABLE=`. 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 8 | 9 | ```json 10 | { 11 | "operator":{ 12 | "component":{ 13 | "minio":true 14 | } 15 | } 16 | } 17 | ``` 18 | 19 | ## General guidelines: 20 | 21 | With the above described behavior we have defined some general rules to be adopted when developing/updating OpenServerless Tasks variables 22 | 23 | - 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. 24 | - 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. 25 | - 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. 26 | - Specify volume size parameters with numerical value expressed as GB 27 | - Specify memory size parameters with numerical value expressed as GB 28 | 29 | ## Variable prefixes category 30 | 31 | This is a comprehensive list of variable prefix used in Ops tasks describing their purpose 32 | 33 | | Variable Prefix | Purpose | 34 | |---|---| 35 | | OPERATOR_COMPONENT_ | Used to defined which OpenServerless Components needs to be deployed by the Operator | 36 | | OPERATOR_CONFIG_ | Global Ops Operator configuration parameters | 37 | | OPENWHISK_CONTROLLER_ | OpenWhisk Controller Configuration | 38 | | OPENWHISK_INVOKER_ | OpenWhisk Invoker Configuration | 39 | | OPENWHISK_ | OpenWhisk General configuration for limits, triggers etc etc | 40 | | STORAGE_SIZE_ | Used to define various component allocated volumes size | 41 | | SECRET_ | Used to define autogenerated secret | 42 | | 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) | -------------------------------------------------------------------------------- /VERSIONS.md: -------------------------------------------------------------------------------- 1 | # Versioning in OpenServerless 2 | 3 | This document lists the versioning scheme adopted in the OpenServerles projects. 4 | 5 | # General schema: 6 | 7 | We use semantic version in this format: 8 | 9 | ``` 10 | X.Y.Z-. 11 | ``` 12 | 13 | the `` is in format `yymmddHHMM` and can be obtained easily with `date +%y%m%d%H%M` 14 | 15 | the `` identifies some state like `` `` or some special cases 16 | 17 | # Tags and branches 18 | 19 | Whem using versions in tags (like in the CLI) the version MUST have the v in front. This is required by GO versioning. 20 | 21 | When using version in branches (like in tasks) the version MUST NOT have the v in from. This makes easier to compare. 22 | 23 | # Image tags 24 | 25 | We should use versions in docker image tags. We have 2 cases: 26 | 27 | - normal tags of OpenServerless images, like the operator: 28 | 29 | we follow the general schema: for example apache/openserverless-operator:0.1.0-alpha.2407311416 30 | 31 | - runtimes 32 | 33 | Runtimes are special because they depends on the language so the version is actually 34 | 35 | ``` 36 | -[.] 37 | ``` 38 | 39 | where: 40 | - `` is the version of the language (Python 3.11, NodeJS 20.1 etc) 41 | - `` is the timestamp (and it is automatically calculated and) 42 | - `` identifies a variant of the image, like an `ai` version (3.11-2407311140.ai) or a customer specific version (3.11-2407311140.ca). 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /aliases: -------------------------------------------------------------------------------- 1 | ## NOTE! This script should be sourced, not executed. 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | alias va="vi ~/openserverless/aliases ; source ~/openserverless/aliases" 21 | 22 | # prompt 23 | parse_git_branch() { 24 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' 25 | } 26 | export PS1="[\h:\[\e[32m\]\w:\[\e[91m\]\$(parse_git_branch)\[\e[00m\]]\n$ " 27 | 28 | 29 | function secrets { 30 | if ! which op 31 | then echo "download the op cli from https://developer.1password.com/docs/cli/get-started/" 32 | return 33 | fi 34 | if ! test -e .env.dist 35 | then echo "no .env.dist listing the required secrets" 36 | return 37 | fi 38 | echo "reading .env.dist to generate .env and .env.src from 1password" 39 | echo "I OVERWRITE the existing files, type your password or interrupt now" 40 | eval $(op signin) 41 | rm -f .env .env.src 42 | cat .env.dist | awk '{ 43 | if(match($1, /^(.*)=(.*):/, a)) { 44 | print a[1] " op://secrets/" a[2] "/" a[1] 45 | } 46 | }' | while read VAR SEC 47 | do 48 | VAL="$(op read $SEC)" 49 | echo read $VAR 50 | echo "$VAR=$VAL" >>.env 51 | echo "echo export and config $VAR" >>.env.src 52 | echo "export $VAR=\"$VAL\"" >>.env.src 53 | echo "nuv -config \"$VAR=$VAL\"" >>.env.src 54 | done 55 | source .env.src 56 | } 57 | 58 | export KNS="default" 59 | alias k='kubectl -n $KNS' 60 | alias kg='kubectl -n $KNS get' 61 | alias kgy='kubectl -n $KNS -o yaml get' 62 | alias kaf='kubectl -n $KNS apply -f' 63 | alias kde='kubectl -n $KNS describe' 64 | alias kdel='kubectl -n $KNS delete' 65 | alias kin="kubectl cluster-info" 66 | 67 | function kex { 68 | ME=$1 69 | CMD=${2:-bash} 70 | kubectl -n $KNS exec -ti $(kubectl -n $KNS get po | awk "/$ME/"'{print $1}') -- $CMD 71 | } 72 | 73 | function klo { 74 | ME=$1 75 | shift 76 | kubectl -n $KNS logs $(kubectl -n $KNS get po | awk "/$ME/"'{print $1}') "$@" 77 | } 78 | 79 | function kns { 80 | if test -z "$1" 81 | then kubectl get ns 82 | echo "*** current: $KNS ***" 83 | else export KNS="$1" 84 | kubectl config set-context --current --namespace "$1" 85 | fi 86 | } 87 | 88 | alias kwa="watch kubectl get po,deploy,sts,jobs,svc,ingress --no-headers" 89 | alias kwp="watch kubectl get po,deploy,sts,jobs --no-headers" 90 | alias kws="watch kubectl get svc,ingress --no-headers" 91 | alias kwc="watch kubectl get cm,secret --no-headers" 92 | 93 | alias kfin='kubectl patch -p {"metadata":{"finalizers":[]}} --type=merge' 94 | 95 | alias ga="git add" 96 | alias gst="git status" 97 | alias glog="git log --pretty=oneline" 98 | alias gdf="git diff --name-only" 99 | alias gcm="git commit -m" 100 | alias gcam="git commit -a -m" 101 | alias gpom="git push origin main" 102 | 103 | function gsnap { 104 | if test -z "$1" 105 | then echo msg please 106 | else x=""; for i in "$@" ; do x="$x$i " ; done 107 | git commit -a -m "$x" 108 | git push 109 | fi 110 | } 111 | 112 | alias t=task 113 | alias tt='task -d ..' 114 | alias ttt='task -d ../..' 115 | alias dtag="date +%y%m%d%H" 116 | alias lenv='export $(xargs <.env)' 117 | alias nssh="ssh -oStrictHostKeyChecking=no" 118 | -------------------------------------------------------------------------------- /assets/logos/png/os-logo-bg-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openserverless/6d90f8dc8f98f9ae3d3cf8840e94c0efb89a81c5/assets/logos/png/os-logo-bg-white.png -------------------------------------------------------------------------------- /assets/logos/png/os-logo-full-horizontal-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openserverless/6d90f8dc8f98f9ae3d3cf8840e94c0efb89a81c5/assets/logos/png/os-logo-full-horizontal-transparent.png -------------------------------------------------------------------------------- /assets/logos/png/os-logo-full-vertical-bg-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openserverless/6d90f8dc8f98f9ae3d3cf8840e94c0efb89a81c5/assets/logos/png/os-logo-full-vertical-bg-white.png -------------------------------------------------------------------------------- /assets/logos/png/os-logo-full-vertical-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openserverless/6d90f8dc8f98f9ae3d3cf8840e94c0efb89a81c5/assets/logos/png/os-logo-full-vertical-transparent.png -------------------------------------------------------------------------------- /assets/logos/png/os-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openserverless/6d90f8dc8f98f9ae3d3cf8840e94c0efb89a81c5/assets/logos/png/os-logo-transparent.png -------------------------------------------------------------------------------- /assets/logos/svg/os-logo-icon-transparent.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cloud-init.yaml: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | apt_update: true 3 | apt_upgrade: true 4 | users: 5 | - name: ubuntu 6 | uid: 1000 7 | groups: sudo 8 | shell: /bin/bash 9 | sudo: ['ALL=(ALL) NOPASSWD:ALL'] 10 | runcmd: 11 | - | 12 | # install k3s, direnv, task 13 | curl -sfL https://get.k3s.io | sh - 14 | curl -sfL https://direnv.net/install.sh | bash 15 | snap install task --classic 16 | cd /tmp 17 | curl https://dlcdn.apache.org/skywalking/eyes/0.6.0/skywalking-license-eye-0.6.0-bin.tgz | tar xzvf - 18 | mv skywalking-license-eye-0.6.0-bin/bin/linux/license-eye /usr/bin/license-eye 19 | rm -Rvf skywalking-license-eye-0.6.0-bin 20 | echo "OPS_CLOUD_INIT_VER=2" >>/etc/environment 21 | - | 22 | # set home and user 23 | USR="$(getent passwd 1000 | awk -F: '{print $1}')" 24 | HOME="/home/$USR" 25 | # copy authkey if there is a root one 26 | if test -e /root/.ssh/authorized_keys 27 | then mkdir -p /home/$USR/.ssh 28 | cat /root/.ssh/authorized_keys >>/home/$USR/.ssh/authorized_keys 29 | fi 30 | # access k3s 31 | mkdir -p "$HOME/.kube" 32 | cp /etc/rancher/k3s/k3s.yaml "$HOME/.kube/config" 33 | echo "export KUBECONFIG=/home/$USR/.kube/config" >>$HOME/.bashrc 34 | # use direnv for autoinit 35 | echo 'eval "$(direnv hook bash)"' >>$HOME/.bashrc 36 | # install nix 37 | curl -L https://nixos.org/nix/install | sudo -u "$USR" sh 38 | # get openserverless sources 39 | cd $HOME 40 | # add z.sh 41 | curl "https://raw.githubusercontent.com/rupa/z/master/z.sh" -o "$HOME/.z.sh" 42 | echo "source $HOME/.z.sh" >> $HOME/.bashrc 43 | # add aliases 44 | echo "source $HOME/openserverless/aliases" >>$HOME/.bashrc 45 | # change owner to everything 46 | chown -Rvf "$USR" "$HOME" 47 | # allow direnv for submodules 48 | sudo -u $USR git clone https://github.com/apache/openserverless --recurse-submodules 49 | cd $HOME/openserverless 50 | sudo -u $USR bash sync-branch.sh 51 | sudo -i -H -u $USR bash "$HOME/openserverless/direnv-init.sh" 52 | # install license-eye and a git-hook 53 | sudo -u $USR git config core.hooksPath .git-hooks 54 | 55 | -------------------------------------------------------------------------------- /devel/images/standalone/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11 2 | ADD openwhisk-standalone.jar /openwhisk-standalone.jar 3 | 4 | -------------------------------------------------------------------------------- /devel/images/standalone/Taskfile.yml: -------------------------------------------------------------------------------- 1 | version: 3 2 | 3 | vars: 4 | STANDALONE: "openwhisk/standalone:7ef091c" 5 | IMAGE: "ghcr.io/sciabarracom/standalone:2506121330" 6 | 7 | tasks: 8 | 9 | default: 10 | desc: "build" 11 | cmds: 12 | - task: extract 13 | - > 14 | docker build 15 | -t "{{.IMAGE}}" . 16 | 17 | extract: 18 | desc: "Extract the tarball" 19 | cmds: 20 | - | 21 | docker run --rm --privileged tonistiigi/binfmt --install all 22 | docker pull --platform=linux/amd64 "{{.STANDALONE}}" 23 | docker create --name=standalone --platform=linux/amd64 "{{.STANDALONE}}" 24 | docker cp standalone:/openwhisk-standalone.jar . 25 | docker rm standalone 26 | status: 27 | - test -e openwhisk-standalone.jar 28 | 29 | -------------------------------------------------------------------------------- /direnv-init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$(dirname "${BASH_SOURCE[0]}")" && pwd 3 | git clone https://github.com/nix-community/nix-direnv $HOME/nix-direnv 4 | mkdir -p $HOME/.config/direnv 5 | echo 'source $HOME/nix-direnv/direnvrc' >>$HOME/.config/direnv/direnvrc 6 | find . -name '.envrc' -execdir direnv allow . pwd \; 7 | find . -name '.envrc' -execdir direnv exec . pwd \; 8 | 9 | -------------------------------------------------------------------------------- /get-diff.sh: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | F=${1:?file} 19 | 20 | FILE=$(realpath $F) 21 | echo $FILE 22 | 23 | CUR="$(basename $FILE)" 24 | CONT="$(dirname $FILE)" 25 | while ! test -d ${CONT}.diff 26 | do 27 | echo $CUR 28 | CUR="$(basename $CONT)/$CUR" 29 | CONT=$(dirname $CONT) 30 | echo $CONT 31 | done 32 | 33 | echo CONTAINER $CONT 34 | echo PATH $CUR 35 | 36 | code -r -d ${CONT}.diff/$CUR $CONT/$CUR -------------------------------------------------------------------------------- /openserverless-cli.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "name": "cli", 5 | "path": "cli" 6 | }, 7 | { 8 | "name": "task", 9 | "path": "task" 10 | } 11 | ], 12 | "settings": { 13 | "workbench.colorCustomizations": { 14 | "activityBar.background": "#5b09e0", 15 | "titleBar.activeBackground": "#5b09e0", 16 | "titleBar.activeForeground": "#5b09e0", 17 | "statusBar.background": "#5b09e0" 18 | }, 19 | "go.goroot": "/nix/store/nnh57s7m672k6snkanhz1kb18skwjpbg-go-1.21.11/share/go" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /openserverless-operator.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "name": "openserverless-operator", 5 | "path": "operator" 6 | } 7 | ], 8 | "settings": { 9 | "workbench.colorCustomizations": { 10 | "activityBar.background": "#32cb0f", 11 | "titleBar.activeBackground": "#32cb0f", 12 | "titleBar.activeForeground": "#32cb0f", 13 | "statusBar.background": "#32cb0f" 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openserverless.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "name": "operator", 5 | "path": "operator" 6 | }, 7 | { 8 | "name": "site", 9 | "path": "site" 10 | }, 11 | { 12 | "name": "root", 13 | "path": "." 14 | } 15 | ], 16 | "settings": { 17 | "workbench.colorCustomizations": { 18 | "activityBar.background": "#d2e313", 19 | "titleBar.activeBackground": "#d2e313", 20 | "titleBar.activeForeground": "#d2e313", 21 | "statusBar.background": "#d2e313" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sync-branch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | me="$(realpath $0)" 3 | if test -z "$1" 4 | then 5 | cd "$(dirname $0)" 6 | git submodule --quiet foreach --recursive "$me \$toplevel/.gitmodules \$name" 7 | #>_submodules 8 | #cat _submodules 9 | else 10 | #echo "*** $1 - $2 ***" 11 | #pwd 12 | BRANCH=$(git config -f "$1" "submodule.$2.branch") 13 | if test -z "$BRANCH" 14 | then echo "??? $(pwd) no branch: $2" 15 | else 16 | CUR=$(git rev-parse --abbrev-ref HEAD) 17 | if test "$CUR" = "HEAD" 18 | then git checkout "origin/$BRANCH" -B "$BRANCH" 19 | else 20 | if test "$CUR" = "$BRANCH" 21 | then echo "ok: $2@$CUR " 22 | else echo "!!! $2: found: $CUR expected: $BRANCH" 23 | fi 24 | fi 25 | fi 26 | fi -------------------------------------------------------------------------------- /update-tree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git pull origin main --rebase 3 | git submodule update --recursive --remote 4 | bash sync-branch.sh 5 | --------------------------------------------------------------------------------